fhir-dosage-utils 1.1.0 → 1.1.1
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/locales/de/common.json +32 -24
- package/dist/locales/en/common.json +32 -24
- package/dist/locales/fr/common.json +32 -24
- package/dist/locales/nl/common.json +32 -24
- package/dist/main.js +147 -131
- package/dist/main.js.map +1 -1
- package/dist/module.js +147 -131
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
@@ -3,23 +3,39 @@
|
|
3
3
|
"and": "und",
|
4
4
|
"then": "dann"
|
5
5
|
},
|
6
|
+
"amount": {
|
7
|
+
"range": {
|
8
|
+
"withUnit": {
|
9
|
+
"lowAndHigh": "zwischen {{low}} und {{high}} {{unit}}",
|
10
|
+
"onlyHigh": "bis {{high}} {{unit}}",
|
11
|
+
"onlyLow": "mindestens {{low}} {{unit}}"
|
12
|
+
},
|
13
|
+
"withoutUnit": {
|
14
|
+
"lowAndHigh": "zwischen {{low}} und {{high}}",
|
15
|
+
"onlyHigh": "bis {{high}}",
|
16
|
+
"onlyLow": "mindestens {{low}}"
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"ratio": {
|
20
|
+
"withUnit": {
|
21
|
+
"numerator": "{{count}} {{numeratorUnit}}",
|
22
|
+
"denominator_one": "pro {{denominatorUnit}}",
|
23
|
+
"denominator_other": "jeder {{count}} {{denominatorUnit}}"
|
24
|
+
},
|
25
|
+
"withoutUnit": {
|
26
|
+
"numerator": "{{count}}",
|
27
|
+
"denominator_one": ":{{count}}",
|
28
|
+
"denominator_other": ":{{count}}"
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"quantity": "{{quantity}} {{unit}}"
|
32
|
+
},
|
6
33
|
"fields": {
|
7
34
|
"doseQuantity": "{{quantity}} {{unit}}",
|
8
|
-
"doseRange": {
|
9
|
-
"lowAndHigh": "zwischen {{low}} und {{high}} {{unit}}",
|
10
|
-
"onlyHigh": "bis {{high}} {{unit}}",
|
11
|
-
"onlyLow": "{{low}} {{unit}}"
|
12
|
-
},
|
35
|
+
"doseRange": "{{rangeText}}",
|
13
36
|
"rateQuantity": "mit einem Verhältnis von {{quantity}} {{unit}}",
|
14
|
-
"rateRange": {
|
15
|
-
|
16
|
-
"onlyHigh": "mit einem Verhältnis von {{high}} {{unit}}",
|
17
|
-
"onlyLow": "mit einem Verhältnis von {{low}} {{unit}}"
|
18
|
-
},
|
19
|
-
"rateRatio": {
|
20
|
-
"rateRatio_one": "mit einem Verhältnis von {{quantityNumerator}} {{numeratorUnit}} pro {{denominatorUnit}}",
|
21
|
-
"rateRatio_other": "mit einem Verhältnis von {{quantityNumerator}} {{numeratorUnit}} jeder {{count}} {{denominatorUnit}}"
|
22
|
-
},
|
37
|
+
"rateRange": "mit einem Verhältnis von {{rangeText}}",
|
38
|
+
"rateRatio": "mit einem Verhältnis von {{ratioText}}",
|
23
39
|
"duration": "für {{durationText}}",
|
24
40
|
"durationMax": "(maximal {{durationMaxText}})",
|
25
41
|
"frequency": {
|
@@ -54,11 +70,7 @@
|
|
54
70
|
"onlyStart": "ab {{start}}",
|
55
71
|
"onlyEnd": "bis {{end}}"
|
56
72
|
},
|
57
|
-
"boundsRange": {
|
58
|
-
"lowAndHigh": "für {{low}} bis {{high}} {{unit}}",
|
59
|
-
"onlyHigh": "bis {{high}} {{unit}}",
|
60
|
-
"onlyLow": "für mindestens {{low}} {{unit}}"
|
61
|
-
},
|
73
|
+
"boundsRange": "für {{rangeText}}",
|
62
74
|
"count": {
|
63
75
|
"count_one": "{{count}} Mal nehmen",
|
64
76
|
"count_other": "{{count}} Mal nehmen"
|
@@ -73,10 +85,6 @@
|
|
73
85
|
},
|
74
86
|
"maxDosePerLifetime": "bis zu einer maximalen Menge von {{count}} {{unit}} über die Lebenszeit des Patienten",
|
75
87
|
"maxDosePerAdministration": "bis zu einer maximalen Menge von {{count}} {{unit}} pro Dosis",
|
76
|
-
"maxDosePerPeriod": {
|
77
|
-
"general": "bis zu einer maximalen Menge von {{maxDosePerPeriodText}}",
|
78
|
-
"maxDosePerPeriod_one": "{{quantityNumerator}} {{numeratorUnit}} pro {{denominatorUnit}}",
|
79
|
-
"maxDosePerPeriod_other": "{{quantityNumerator}} {{numeratorUnit}} jeder {{count}} {{denominatorUnit}}"
|
80
|
-
}
|
88
|
+
"maxDosePerPeriod": "bis zu einer maximalen Menge von {{maxDosePerPeriodText}}"
|
81
89
|
}
|
82
90
|
}
|
@@ -3,23 +3,39 @@
|
|
3
3
|
"and": "and",
|
4
4
|
"then": "then"
|
5
5
|
},
|
6
|
+
"amount": {
|
7
|
+
"range": {
|
8
|
+
"withUnit": {
|
9
|
+
"lowAndHigh": "{{low}} to {{high}} {{unit}}",
|
10
|
+
"onlyHigh": "up to {{high}} {{unit}}",
|
11
|
+
"onlyLow": "at least {{low}} {{unit}}"
|
12
|
+
},
|
13
|
+
"withoutUnit": {
|
14
|
+
"lowAndHigh": "{{low}} to {{high}}",
|
15
|
+
"onlyHigh": "up to {{high}}",
|
16
|
+
"onlyLow": "at least {{low}}"
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"ratio": {
|
20
|
+
"withUnit": {
|
21
|
+
"numerator": "{{count}} {{numeratorUnit}}",
|
22
|
+
"denominator_one": "per {{denominatorUnit}}",
|
23
|
+
"denominator_other": "every {{count}} {{denominatorUnit}}"
|
24
|
+
},
|
25
|
+
"withoutUnit": {
|
26
|
+
"numerator": "{{count}}",
|
27
|
+
"denominator_one": ":{{count}}",
|
28
|
+
"denominator_other": ":{{count}}"
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"quantity": "{{quantity}} {{unit}}"
|
32
|
+
},
|
6
33
|
"fields": {
|
7
34
|
"doseQuantity": "{{quantity}} {{unit}}",
|
8
|
-
"doseRange": {
|
9
|
-
"lowAndHigh": "{{low}} to {{high}} {{unit}}",
|
10
|
-
"onlyHigh": "up to {{high}} {{unit}}",
|
11
|
-
"onlyLow": "{{low}} {{unit}}"
|
12
|
-
},
|
35
|
+
"doseRange": "{{rangeText}}",
|
13
36
|
"rateQuantity": "at a rate of {{quantity}} {{unit}}",
|
14
|
-
"rateRange": {
|
15
|
-
|
16
|
-
"onlyHigh": "at a rate of {{high}} {{unit}}",
|
17
|
-
"onlyLow": "at a rate of {{low}} {{unit}}"
|
18
|
-
},
|
19
|
-
"rateRatio": {
|
20
|
-
"rateRatio_one": "at a rate of {{quantityNumerator}} {{numeratorUnit}} per {{denominatorUnit}}",
|
21
|
-
"rateRatio_other": "at a rate of {{quantityNumerator}} {{numeratorUnit}} every {{count}} {{denominatorUnit}}"
|
22
|
-
},
|
37
|
+
"rateRange": "at a rate of {{rangeText}}",
|
38
|
+
"rateRatio": "at a rate of {{ratioText}}",
|
23
39
|
"duration": "over {{durationText}}",
|
24
40
|
"durationMax": "(maximum {{durationMaxText}})",
|
25
41
|
"frequency": {
|
@@ -54,11 +70,7 @@
|
|
54
70
|
"onlyStart": "from {{start}}",
|
55
71
|
"onlyEnd": "to {{end}}"
|
56
72
|
},
|
57
|
-
"boundsRange": {
|
58
|
-
"lowAndHigh": "for {{low}} to {{high}} {{unit}}",
|
59
|
-
"onlyHigh": "for up to {{high}} {{unit}}",
|
60
|
-
"onlyLow": "for at least {{low}} {{unit}}"
|
61
|
-
},
|
73
|
+
"boundsRange": "for {{rangeText}}",
|
62
74
|
"count": {
|
63
75
|
"count_one": "take {{count}} time",
|
64
76
|
"count_other": "take {{count}} times"
|
@@ -73,10 +85,6 @@
|
|
73
85
|
},
|
74
86
|
"maxDosePerLifetime": "up to a maximum of {{count}} {{unit}} for the lifetime of patient",
|
75
87
|
"maxDosePerAdministration": "up to a maximum of {{count}} {{unit}} per dose",
|
76
|
-
"maxDosePerPeriod": {
|
77
|
-
"general": "up to a maximum of {{maxDosePerPeriodText}}",
|
78
|
-
"maxDosePerPeriod_one": "{{quantityNumerator}} {{numeratorUnit}} per {{denominatorUnit}}",
|
79
|
-
"maxDosePerPeriod_other": "{{quantityNumerator}} {{numeratorUnit}} every {{count}} {{denominatorUnit}}"
|
80
|
-
}
|
88
|
+
"maxDosePerPeriod": "up to a maximum of {{maxDosePerPeriodText}}"
|
81
89
|
}
|
82
90
|
}
|
@@ -3,23 +3,39 @@
|
|
3
3
|
"and": "et",
|
4
4
|
"then": "puis"
|
5
5
|
},
|
6
|
+
"amount": {
|
7
|
+
"range": {
|
8
|
+
"withUnit": {
|
9
|
+
"lowAndHigh": "{{low}} à {{high}} {{unit}}",
|
10
|
+
"onlyHigh": "jusqu'à {{high}} {{unit}}",
|
11
|
+
"onlyLow": "au moins {{low}} {{unit}}"
|
12
|
+
},
|
13
|
+
"withoutUnit": {
|
14
|
+
"lowAndHigh": "{{low}} à {{high}}",
|
15
|
+
"onlyHigh": "jusqu'à {{high}}",
|
16
|
+
"onlyLow": "au moins {{low}}"
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"ratio": {
|
20
|
+
"withUnit": {
|
21
|
+
"numerator": "{{count}} {{numeratorUnit}}",
|
22
|
+
"denominator_one": "par {{denominatorUnit}}",
|
23
|
+
"denominator_other": "chaque {{count}} {{denominatorUnit}}"
|
24
|
+
},
|
25
|
+
"withoutUnit": {
|
26
|
+
"numerator": "{{count}}",
|
27
|
+
"denominator_one": ":{{count}}",
|
28
|
+
"denominator_other": ":{{count}}"
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"quantity": "{{quantity}} {{unit}}"
|
32
|
+
},
|
6
33
|
"fields": {
|
7
34
|
"doseQuantity": "{{quantity}} {{unit}}",
|
8
|
-
"doseRange": {
|
9
|
-
"lowAndHigh": "{{low}} à {{high}} {{unit}}",
|
10
|
-
"onlyHigh": "jusqu'à {{high}} {{unit}}",
|
11
|
-
"onlyLow": "{{low}} {{unit}}"
|
12
|
-
},
|
35
|
+
"doseRange": "{{rangeText}}",
|
13
36
|
"rateQuantity": "au taux de {{quantity}} {{unit}}",
|
14
|
-
"rateRange": {
|
15
|
-
|
16
|
-
"onlyHigh": "au taux de {{high}} {{unit}}",
|
17
|
-
"onlyLow": "au taux de {{low}} {{unit}}"
|
18
|
-
},
|
19
|
-
"rateRatio": {
|
20
|
-
"rateRatio_one": "au taux de {{quantityNumerator}} {{numeratorUnit}} par {{denominatorUnit}}",
|
21
|
-
"rateRatio_other": "au taux de {{quantityNumerator}} {{numeratorUnit}} chaque {{count}} {{denominatorUnit}}"
|
22
|
-
},
|
37
|
+
"rateRange": "au taux de {{rangeText}}",
|
38
|
+
"rateRatio": "au taux de {{ratioText}}",
|
23
39
|
"duration": "durant {{durationText}}",
|
24
40
|
"durationMax": "(maximum {{durationMaxText}})",
|
25
41
|
"frequency": {
|
@@ -54,11 +70,7 @@
|
|
54
70
|
"onlyStart": "à partir du {{start}}",
|
55
71
|
"onlyEnd": "jusqu'au {{end}}"
|
56
72
|
},
|
57
|
-
"boundsRange": {
|
58
|
-
"lowAndHigh": "de {{low}} à {{high}} {{unit}}",
|
59
|
-
"onlyHigh": "jusqu'à {{high}} {{unit}}",
|
60
|
-
"onlyLow": "pour au moins {{low}} {{unit}}"
|
61
|
-
},
|
73
|
+
"boundsRange": "pour {{rangeText}}",
|
62
74
|
"count": {
|
63
75
|
"count_one": "prendre {{count}} fois",
|
64
76
|
"count_other": "prendre {{count}} fois"
|
@@ -73,10 +85,6 @@
|
|
73
85
|
},
|
74
86
|
"maxDosePerLifetime": "jusqu'à un maximum de {{count}} {{unit}} pour la durée de vie du patient",
|
75
87
|
"maxDosePerAdministration": "jusqu'à un maximum de {{count}} {{unit}} par dose",
|
76
|
-
"maxDosePerPeriod": {
|
77
|
-
"general": "jusqu'à un maximum de {{maxDosePerPeriodText}}",
|
78
|
-
"maxDosePerPeriod_one": "{{quantityNumerator}} {{numeratorUnit}} par {{denominatorUnit}}",
|
79
|
-
"maxDosePerPeriod_other": "{{quantityNumerator}} {{numeratorUnit}} chaque {{count}} {{denominatorUnit}}"
|
80
|
-
}
|
88
|
+
"maxDosePerPeriod": "jusqu'à un maximum de {{maxDosePerPeriodText}}"
|
81
89
|
}
|
82
90
|
}
|
@@ -3,23 +3,39 @@
|
|
3
3
|
"and": "en",
|
4
4
|
"then": "vervolgens"
|
5
5
|
},
|
6
|
+
"amount": {
|
7
|
+
"range": {
|
8
|
+
"withUnit": {
|
9
|
+
"lowAndHigh": "tussen {{low}} en {{high}} {{unit}}",
|
10
|
+
"onlyHigh": "tot {{high}} {{unit}}",
|
11
|
+
"onlyLow": "minstens {{low}} {{unit}}"
|
12
|
+
},
|
13
|
+
"withoutUnit": {
|
14
|
+
"lowAndHigh": "tussen {{low}} en {{high}}",
|
15
|
+
"onlyHigh": "tot {{high}}",
|
16
|
+
"onlyLow": "minstens {{low}}"
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"ratio": {
|
20
|
+
"withUnit": {
|
21
|
+
"numerator": "{{count}} {{numeratorUnit}}",
|
22
|
+
"denominator_one": "per {{denominatorUnit}}",
|
23
|
+
"denominator_other": "elke {{count}} {{denominatorUnit}}"
|
24
|
+
},
|
25
|
+
"withoutUnit": {
|
26
|
+
"numerator": "{{count}}",
|
27
|
+
"denominator_one": ":{{count}}",
|
28
|
+
"denominator_other": ":{{count}}"
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"quantity": "{{quantity}} {{unit}}"
|
32
|
+
},
|
6
33
|
"fields": {
|
7
34
|
"doseQuantity": "{{quantity}} {{unit}}",
|
8
|
-
"doseRange": {
|
9
|
-
"lowAndHigh": "tussen {{low}} en {{high}} {{unit}}",
|
10
|
-
"onlyHigh": "tot {{high}} {{unit}}",
|
11
|
-
"onlyLow": "{{low}} {{unit}}"
|
12
|
-
},
|
35
|
+
"doseRange": "{{rangeText}}",
|
13
36
|
"rateQuantity": "met een verhouding van {{quantity}} {{unit}}",
|
14
|
-
"rateRange": {
|
15
|
-
|
16
|
-
"onlyHigh": "met een verhouding van {{high}} {{unit}}",
|
17
|
-
"onlyLow": "met een verhouding van {{low}} {{unit}}"
|
18
|
-
},
|
19
|
-
"rateRatio": {
|
20
|
-
"rateRatio_one": "met een verhouding van {{quantityNumerator}} {{numeratorUnit}} per {{denominatorUnit}}",
|
21
|
-
"rateRatio_other": "met een verhouding van {{quantityNumerator}} {{numeratorUnit}} elke {{count}} {{denominatorUnit}}"
|
22
|
-
},
|
37
|
+
"rateRange": "met een verhouding van {{rangeText}}",
|
38
|
+
"rateRatio": "met een verhouding van {{ratioText}}",
|
23
39
|
"duration": "gedurende {{durationText}}",
|
24
40
|
"durationMax": "(maximaal {{durationMaxText}})",
|
25
41
|
"frequency": {
|
@@ -54,11 +70,7 @@
|
|
54
70
|
"onlyStart": "van {{start}}",
|
55
71
|
"onlyEnd": "tot {{end}}"
|
56
72
|
},
|
57
|
-
"boundsRange": {
|
58
|
-
"lowAndHigh": "gedurende {{low}} tot {{high}} {{unit}}",
|
59
|
-
"onlyHigh": "tot {{high}} {{unit}}",
|
60
|
-
"onlyLow": "gedurende minstens {{low}} {{unit}}"
|
61
|
-
},
|
73
|
+
"boundsRange": "gedurende {{rangeText}}",
|
62
74
|
"count": {
|
63
75
|
"count_one": "{{count}} keer nemen",
|
64
76
|
"count_other": "{{count}} keer nemen"
|
@@ -73,10 +85,6 @@
|
|
73
85
|
},
|
74
86
|
"maxDosePerLifetime": "tot een maximum van {{count}} {{unit}} gedurende de levensduur van de patiënt",
|
75
87
|
"maxDosePerAdministration": "tot een maximum van {{count}} {{unit}} per dosis",
|
76
|
-
"maxDosePerPeriod": {
|
77
|
-
"general": "tot een maximum van {{maxDosePerPeriodText}}",
|
78
|
-
"maxDosePerPeriod_one": "{{quantityNumerator}} {{numeratorUnit}} per {{denominatorUnit}}",
|
79
|
-
"maxDosePerPeriod_other": "{{quantityNumerator}} {{numeratorUnit}} elke {{count}} {{denominatorUnit}}"
|
80
|
-
}
|
88
|
+
"maxDosePerPeriod": "tot een maximum van {{maxDosePerPeriodText}}"
|
81
89
|
}
|
82
90
|
}
|
package/dist/main.js
CHANGED
@@ -72,43 +72,77 @@ function $5ab57a471c359130$export$7de3722258b87db9({ config: config, dos: dos, i
|
|
72
72
|
}
|
73
73
|
|
74
74
|
|
75
|
-
//
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
//
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
let unit = config.fromFHIRQuantityUnitToString({
|
75
|
+
// Utility function
|
76
|
+
// Quantity unit to string
|
77
|
+
function $9ee880701f47723b$var$transformQuantityUnitToString(i18next, quantity, config) {
|
78
|
+
let quantityValue = quantity.value;
|
79
|
+
// If common units from HL7, do the job
|
80
|
+
if (quantity.system === "http://hl7.org/fhir/ValueSet/duration-units") {
|
81
|
+
let code = quantity.code;
|
82
|
+
return i18next.t(`unitsOfTime:withoutCount.${code}`, {
|
83
|
+
count: quantityValue
|
84
|
+
});
|
85
|
+
} else // otherwise, it is UCUM, ... so let the user do the job
|
86
|
+
return config.fromFHIRQuantityUnitToString({
|
88
87
|
language: config.language,
|
89
|
-
quantity:
|
88
|
+
quantity: quantity
|
90
89
|
});
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
90
|
+
}
|
91
|
+
function $9ee880701f47723b$export$be17d167ed50d870({ range: range, config: config, i18next: i18next }) {
|
92
|
+
// Extract params
|
93
|
+
const { low: low, high: high } = range;
|
94
|
+
const lowValue = low?.value;
|
95
|
+
const highValue = high?.value;
|
96
|
+
// prepare unit display
|
97
|
+
let quantityUnit = high || low;
|
98
|
+
let hasUnit = quantityUnit?.unit !== undefined || quantityUnit?.code !== undefined;
|
99
|
+
// Four cases
|
100
|
+
// 1. If we have a empty object, return undefined
|
101
|
+
if (lowValue === undefined && highValue === undefined) return undefined;
|
102
|
+
// quantity unit
|
103
|
+
let unit = hasUnit ? $9ee880701f47723b$var$transformQuantityUnitToString(i18next, quantityUnit, config) : "";
|
104
|
+
let technicalKey = hasUnit ? "withUnit" : "withoutUnit";
|
105
|
+
// 2. Both low & high are present
|
106
|
+
if (lowValue !== undefined && highValue !== undefined) return i18next.t(`amount.range.${technicalKey}.lowAndHigh`, {
|
107
|
+
low: lowValue,
|
108
|
+
high: highValue,
|
96
109
|
unit: unit
|
97
110
|
});
|
98
|
-
//
|
99
|
-
if (
|
100
|
-
high:
|
111
|
+
// 3. Only high is present
|
112
|
+
if (highValue !== undefined) return i18next.t(`amount.range.${technicalKey}.onlyHigh`, {
|
113
|
+
high: highValue,
|
101
114
|
unit: unit
|
102
115
|
});
|
103
|
-
//
|
116
|
+
// 4. Only low is present
|
104
117
|
// Warning, this case is kind dangerous and clinically unsafe so minimal effort on this ...
|
105
|
-
return i18next.t(
|
106
|
-
low:
|
118
|
+
return i18next.t(`amount.range.${technicalKey}.onlyLow`, {
|
119
|
+
low: lowValue,
|
107
120
|
unit: unit
|
108
121
|
});
|
109
122
|
}
|
110
123
|
|
111
124
|
|
125
|
+
function $9a073aa5b09aa778$export$4cd16590995531a9({ dos: dos, config: config, i18next: i18next }) {
|
126
|
+
// If empty, return undefined
|
127
|
+
if (dos.doseAndRate === undefined) return undefined;
|
128
|
+
// Find the first entry that match criteria
|
129
|
+
let doseRange = dos.doseAndRate.find((s)=>s.doseRange !== undefined);
|
130
|
+
// If not found, skip
|
131
|
+
if (doseRange === undefined) return undefined;
|
132
|
+
// Turn range into a text
|
133
|
+
const text = (0, $9ee880701f47723b$export$be17d167ed50d870)({
|
134
|
+
range: doseRange.doseRange,
|
135
|
+
config: config,
|
136
|
+
i18next: i18next
|
137
|
+
});
|
138
|
+
// Reject if empty
|
139
|
+
if (text === undefined) return undefined;
|
140
|
+
return i18next.t("fields.doseRange", {
|
141
|
+
rangeText: text
|
142
|
+
});
|
143
|
+
}
|
144
|
+
|
145
|
+
|
112
146
|
// types
|
113
147
|
function $052c79abb28cba29$export$4e24ef8c7997cc56({ dos: dos, config: config, i18next: i18next }) {
|
114
148
|
// If empty, return undefined
|
@@ -131,72 +165,91 @@ function $052c79abb28cba29$export$4e24ef8c7997cc56({ dos: dos, config: config, i
|
|
131
165
|
}
|
132
166
|
|
133
167
|
|
134
|
-
//
|
168
|
+
// Utility function
|
169
|
+
|
135
170
|
function $703b645b55481398$export$d3dd7d3522271dba({ dos: dos, config: config, i18next: i18next }) {
|
136
171
|
// If empty, return undefined
|
137
172
|
if (dos.doseAndRate === undefined) return undefined;
|
138
173
|
// Find the first entry that match criteria
|
139
|
-
let
|
174
|
+
let doseAndRate = dos.doseAndRate.find((s)=>s.rateRange !== undefined);
|
140
175
|
// If not found, skip
|
141
|
-
if (
|
142
|
-
//
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
// quantity unit
|
148
|
-
let unit = config.fromFHIRQuantityUnitToString({
|
149
|
-
language: config.language,
|
150
|
-
quantity: high || low
|
151
|
-
});
|
152
|
-
// Three cases
|
153
|
-
// 1. Both low & high are present
|
154
|
-
if (quantityHigh !== undefined && quantityLow !== undefined) return i18next.t("fields.rateRange.lowAndHigh", {
|
155
|
-
low: quantityLow,
|
156
|
-
high: quantityHigh,
|
157
|
-
unit: unit
|
158
|
-
});
|
159
|
-
// 2. Only high is present
|
160
|
-
if (quantityHigh !== undefined) return i18next.t("fields.rateRange.onlyHigh", {
|
161
|
-
high: quantityHigh,
|
162
|
-
unit: unit
|
176
|
+
if (doseAndRate === undefined) return undefined;
|
177
|
+
// Turn range into a text
|
178
|
+
const rangeText = (0, $9ee880701f47723b$export$be17d167ed50d870)({
|
179
|
+
range: doseAndRate.rateRange,
|
180
|
+
config: config,
|
181
|
+
i18next: i18next
|
163
182
|
});
|
164
|
-
//
|
165
|
-
|
166
|
-
return
|
167
|
-
|
168
|
-
|
183
|
+
// Reject if empty
|
184
|
+
if (rangeText === undefined) return undefined;
|
185
|
+
// return the final string
|
186
|
+
return i18next.t("fields.rateRange", {
|
187
|
+
rangeText: rangeText
|
169
188
|
});
|
170
189
|
}
|
171
190
|
|
172
191
|
|
173
|
-
//
|
174
|
-
function $
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
if (rateRatio === undefined) return undefined;
|
181
|
-
// num / dem
|
182
|
-
let numerator = rateRatio.rateRatio.numerator;
|
183
|
-
let denominator = rateRatio.rateRatio.denominator;
|
184
|
-
let quantityNum = numerator?.value || 1;
|
185
|
-
let quantityDenom = denominator?.value || 1;
|
192
|
+
// Quantity has an unit ?
|
193
|
+
function $7895e9944cc835ce$var$hasUnit(quantity) {
|
194
|
+
return (quantity?.unit || quantity?.code) !== undefined;
|
195
|
+
}
|
196
|
+
function $7895e9944cc835ce$export$fdc6e9cbd31555fb({ ratio: ratio, config: config, i18next: i18next }) {
|
197
|
+
// Extract params
|
198
|
+
const { denominator: denominator, numerator: numerator } = ratio;
|
186
199
|
// units as text
|
187
|
-
let numeratorUnit = numerator
|
200
|
+
let numeratorUnit = $7895e9944cc835ce$var$hasUnit(numerator) ? config.fromFHIRQuantityUnitToString({
|
188
201
|
language: config.language,
|
189
202
|
quantity: numerator
|
190
|
-
}) :
|
191
|
-
let denominatorUnit = denominator
|
203
|
+
}) : undefined;
|
204
|
+
let denominatorUnit = $7895e9944cc835ce$var$hasUnit(denominator) ? config.fromFHIRQuantityUnitToString({
|
192
205
|
language: config.language,
|
193
206
|
quantity: denominator
|
194
|
-
}) :
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
207
|
+
}) : undefined;
|
208
|
+
// quantity
|
209
|
+
let quantityNumerator = numerator?.value;
|
210
|
+
let quantityDenominator = denominator?.value;
|
211
|
+
// Collect
|
212
|
+
const parts = [];
|
213
|
+
// Deal with numerator first
|
214
|
+
if (quantityNumerator !== undefined) {
|
215
|
+
let technicalKey = numeratorUnit !== undefined ? "withUnit" : "withoutUnit";
|
216
|
+
const numeratorString = i18next.t(`amount.ratio.${technicalKey}.numerator`, {
|
217
|
+
count: quantityNumerator,
|
218
|
+
numeratorUnit: numeratorUnit
|
219
|
+
});
|
220
|
+
parts.push(numeratorString);
|
221
|
+
}
|
222
|
+
// Deal with denominator
|
223
|
+
if (quantityDenominator !== undefined) {
|
224
|
+
let technicalKey = denominatorUnit !== undefined ? "withUnit" : "withoutUnit";
|
225
|
+
const denominatorString = i18next.t(`amount.ratio.${technicalKey}.denominator`, {
|
226
|
+
count: quantityDenominator,
|
227
|
+
denominatorUnit: denominatorUnit
|
228
|
+
});
|
229
|
+
parts.push(denominatorString);
|
230
|
+
}
|
231
|
+
// Concatenate the result
|
232
|
+
if (parts.length === 0) return undefined;
|
233
|
+
else return parts.join(" ");
|
234
|
+
}
|
235
|
+
|
236
|
+
|
237
|
+
function $301791f33da707fa$export$b71cfd2510242de2({ dos: dos, config: config, i18next: i18next }) {
|
238
|
+
// If empty, return undefined
|
239
|
+
if (dos.doseAndRate === undefined) return undefined;
|
240
|
+
// Find the first entry that match criteria
|
241
|
+
let doseAndRate = dos.doseAndRate.find((s)=>s.rateRatio !== undefined);
|
242
|
+
// If not found, skip
|
243
|
+
if (doseAndRate === undefined) return undefined;
|
244
|
+
// Turn ratio to text
|
245
|
+
const ratioText = (0, $7895e9944cc835ce$export$fdc6e9cbd31555fb)({
|
246
|
+
config: config,
|
247
|
+
i18next: i18next,
|
248
|
+
ratio: doseAndRate.rateRatio
|
249
|
+
});
|
250
|
+
if (ratioText === undefined) return undefined;
|
251
|
+
return i18next.t("fields.rateRatio", {
|
252
|
+
ratioText: ratioText
|
200
253
|
});
|
201
254
|
}
|
202
255
|
|
@@ -496,21 +549,7 @@ function $9d632517596957df$export$b927a06bc51aea32({ dos: dos, config: config, i
|
|
496
549
|
|
497
550
|
|
498
551
|
// types
|
499
|
-
|
500
|
-
function $2da391a8a8345a3d$var$transformQuantityUnitToString(i18next, quantity, config) {
|
501
|
-
let quantityValue = quantity.value;
|
502
|
-
// If common units from HL7, do the job
|
503
|
-
if (quantity.system === "http://hl7.org/fhir/ValueSet/duration-units") {
|
504
|
-
let code = quantity.code;
|
505
|
-
return i18next.t(`unitsOfTime:withoutCount.${code}`, {
|
506
|
-
count: quantityValue
|
507
|
-
});
|
508
|
-
} else // otherwise, it is UCUM, ... so let the user do the job
|
509
|
-
return config.fromFHIRQuantityUnitToString({
|
510
|
-
language: config.language,
|
511
|
-
quantity: quantity
|
512
|
-
});
|
513
|
-
}
|
552
|
+
|
514
553
|
function $2da391a8a8345a3d$export$8c667cbf7bebaa93({ dos: dos, config: config, i18next: i18next }) {
|
515
554
|
// If empty, return undefined
|
516
555
|
if (dos.timing === undefined || dos.timing.repeat === undefined) return undefined;
|
@@ -520,26 +559,17 @@ function $2da391a8a8345a3d$export$8c667cbf7bebaa93({ dos: dos, config: config, i
|
|
520
559
|
// Do nothing if no boundsRange, I am not a wizard
|
521
560
|
if (boundsRange === undefined) return undefined;
|
522
561
|
else {
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
// 1. Both low & high are present
|
529
|
-
if (high !== undefined && low !== undefined) return i18next.t("fields.boundsRange.lowAndHigh", {
|
530
|
-
low: low.value,
|
531
|
-
high: high.value,
|
532
|
-
unit: unit
|
533
|
-
});
|
534
|
-
// 2. Only high is present
|
535
|
-
if (high !== undefined) return i18next.t("fields.boundsRange.onlyHigh", {
|
536
|
-
high: high.value,
|
537
|
-
unit: unit
|
562
|
+
// Turn range into a text
|
563
|
+
const rangeText = (0, $9ee880701f47723b$export$be17d167ed50d870)({
|
564
|
+
range: boundsRange,
|
565
|
+
config: config,
|
566
|
+
i18next: i18next
|
538
567
|
});
|
539
|
-
//
|
540
|
-
|
541
|
-
|
542
|
-
|
568
|
+
// Reject if empty
|
569
|
+
if (rangeText === undefined) return undefined;
|
570
|
+
// return the final string
|
571
|
+
return i18next.t("fields.boundsRange", {
|
572
|
+
rangeText: rangeText
|
543
573
|
});
|
544
574
|
}
|
545
575
|
}
|
@@ -764,6 +794,7 @@ function $45256d2a188dcbd7$export$75a89431d80a701a({ dos: dos, config: config, i
|
|
764
794
|
|
765
795
|
|
766
796
|
|
797
|
+
|
767
798
|
function $39ffdeadc450f558$export$346b11a8cb220f02({ dos: dos, config: config, i18next: i18next }) {
|
768
799
|
// If empty, return undefined
|
769
800
|
if (dos.maxDosePerPeriod === undefined) return undefined;
|
@@ -778,29 +809,14 @@ function $39ffdeadc450f558$export$346b11a8cb220f02({ dos: dos, config: config, i
|
|
778
809
|
if (values.length === 0) return undefined;
|
779
810
|
// Periods are expressed as ratio (like rateRatio)
|
780
811
|
const valuesAsString = values.map((period)=>{
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
let quantityDenom = denominator?.value || 1;
|
786
|
-
// units as text
|
787
|
-
let numeratorUnit = numerator !== undefined ? config.fromFHIRQuantityUnitToString({
|
788
|
-
language: config.language,
|
789
|
-
quantity: numerator
|
790
|
-
}) : "";
|
791
|
-
let denominatorUnit = denominator !== undefined ? config.fromFHIRQuantityUnitToString({
|
792
|
-
language: config.language,
|
793
|
-
quantity: denominator
|
794
|
-
}) : "";
|
795
|
-
return i18next.t("fields.maxDosePerPeriod.maxDosePerPeriod", {
|
796
|
-
count: quantityDenom,
|
797
|
-
quantityNumerator: quantityNum,
|
798
|
-
numeratorUnit: numeratorUnit,
|
799
|
-
denominatorUnit: denominatorUnit
|
812
|
+
return (0, $7895e9944cc835ce$export$fdc6e9cbd31555fb)({
|
813
|
+
config: config,
|
814
|
+
i18next: i18next,
|
815
|
+
ratio: period
|
800
816
|
});
|
801
|
-
});
|
817
|
+
}).filter((s)=>s !== undefined);
|
802
818
|
const maxDosePerPeriodText = (0, $93b58b7d2ead3b95$export$826742c1df3eca39)(i18next, valuesAsString);
|
803
|
-
return i18next.t("fields.maxDosePerPeriod
|
819
|
+
return i18next.t("fields.maxDosePerPeriod", {
|
804
820
|
count: values.length,
|
805
821
|
maxDosePerPeriodText: maxDosePerPeriodText
|
806
822
|
});
|