fhir-dosage-utils 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/locales/de/common.json +1 -1
- package/dist/locales/de/quantityComparator.json +1 -0
- package/dist/locales/en/common.json +1 -1
- package/dist/locales/en/quantityComparator.json +1 -0
- package/dist/locales/fr/common.json +1 -1
- package/dist/locales/fr/quantityComparator.json +1 -0
- package/dist/locales/nl/common.json +1 -1
- package/dist/locales/nl/quantityComparator.json +1 -0
- package/dist/main.js +187 -154
- package/dist/main.js.map +1 -1
- package/dist/module.js +187 -154
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
@@ -29,22 +29,30 @@ function $1c57f108974f2805$export$b1a6aed91fad1636({ quantity: quantity }) {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
|
32
|
+
// Functions
|
33
|
+
function $7642ff4865ae4b0f$export$d9ff4a623e416a11(array) {
|
34
|
+
return array === undefined || array.length === 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
|
32
38
|
function $a6c648898dc8c3b6$export$f478f96b98da13a4({ code: code }) {
|
33
39
|
// If no code, skip it
|
34
40
|
if (code === undefined) return undefined;
|
35
41
|
// Take text first
|
36
42
|
if (code.text !== undefined) return code.text;
|
37
43
|
// If empty, skip it
|
38
|
-
if (
|
44
|
+
if ((0, $7642ff4865ae4b0f$export$d9ff4a623e416a11)(code.coding)) return undefined;
|
39
45
|
// Take first coding; display first then code
|
40
46
|
let firstCode = code.coding[0];
|
41
47
|
return firstCode.display || firstCode.code;
|
42
48
|
}
|
43
49
|
|
44
50
|
|
51
|
+
// Functions
|
52
|
+
|
45
53
|
function $34ebae8ac5b52fcd$export$30c337e25ab8e95b({ extensions: extensions }) {
|
46
54
|
// If no extensions, skip it
|
47
|
-
if (
|
55
|
+
if ((0, $7642ff4865ae4b0f$export$d9ff4a623e416a11)(extensions)) return undefined;
|
48
56
|
// KIS implementation : print it as provided, without doing anything
|
49
57
|
// Extensions have so many cases btw, that having a basic function does the trick
|
50
58
|
return extensions.map((extension)=>JSON.stringify(extension)).join(" ");
|
@@ -107,7 +115,8 @@ class $868b4eaa4f62b9f7$export$f807d9a22ff8372d {
|
|
107
115
|
"common",
|
108
116
|
"daysOfWeek",
|
109
117
|
"eventTiming",
|
110
|
-
"unitsOfTime"
|
118
|
+
"unitsOfTime",
|
119
|
+
"quantityComparator"
|
111
120
|
],
|
112
121
|
defaultNS: "common",
|
113
122
|
// attributes set by user
|
@@ -206,13 +215,19 @@ function $6ce94eb09701f53d$export$e9106be159f8c977({ quantity: quantity, config:
|
|
206
215
|
});
|
207
216
|
let value = quantity.value || 1;
|
208
217
|
// If no unit is present (in other words ""), we don't put it
|
209
|
-
|
218
|
+
let quantityString = unit.length === 0 ? i18next.t("amount.quantity.withoutUnit", {
|
210
219
|
quantity: value
|
211
|
-
})
|
212
|
-
else return i18next.t("amount.quantity.withUnit", {
|
220
|
+
}) : i18next.t("amount.quantity.withUnit", {
|
213
221
|
quantity: value,
|
214
222
|
unit: unit
|
215
223
|
});
|
224
|
+
// Compute the comparator
|
225
|
+
let comparatorCode = quantity.comparator;
|
226
|
+
let comparatorString = comparatorCode !== undefined ? i18next.t(`quantityComparator:${comparatorCode}`) : undefined;
|
227
|
+
// If no comparator, print it
|
228
|
+
if (comparatorString === undefined) return quantityString;
|
229
|
+
else // concatenate comparator and quantity
|
230
|
+
return `${comparatorString} ${quantityString}`;
|
216
231
|
}
|
217
232
|
|
218
233
|
|
@@ -241,7 +256,8 @@ function $9ee880701f47723b$var$transformQuantityUnitToString(i18next, quantity,
|
|
241
256
|
return i18next.t(`unitsOfTime:withoutCount.${code}`, {
|
242
257
|
count: quantityValue
|
243
258
|
});
|
244
|
-
}
|
259
|
+
}
|
260
|
+
// otherwise, it is UCUM, ... so let the user do the job
|
245
261
|
return config.fromFHIRQuantityUnitToString({
|
246
262
|
language: config.language,
|
247
263
|
quantity: quantity
|
@@ -339,50 +355,68 @@ function $703b645b55481398$export$d3dd7d3522271dba({ dos: dos, config: config, i
|
|
339
355
|
}
|
340
356
|
|
341
357
|
|
358
|
+
// Functions
|
359
|
+
|
342
360
|
// Quantity has an unit ?
|
343
361
|
function $7895e9944cc835ce$var$hasUnit(quantity) {
|
344
|
-
return
|
362
|
+
return [
|
363
|
+
quantity?.unit,
|
364
|
+
quantity?.code
|
365
|
+
].some((field)=>field !== undefined);
|
366
|
+
}
|
367
|
+
// To cover all nasty cases of denominator
|
368
|
+
function $7895e9944cc835ce$var$fromDenominatorToString({ config: config, i18next: i18next, quantity: quantity }) {
|
369
|
+
let hasUnitDenominator = $7895e9944cc835ce$var$hasUnit(quantity);
|
370
|
+
let value = quantity.value;
|
371
|
+
// If no unit, it is quite simple
|
372
|
+
if (!hasUnitDenominator) return `:${value}`;
|
373
|
+
// Get correct linkword (depending of the quantity value)
|
374
|
+
let linkword = i18next.t("amount.ratio.denominatorLinkword", {
|
375
|
+
count: value
|
376
|
+
});
|
377
|
+
// Get quantity text (depending of the quantity value)
|
378
|
+
let quantityText = value !== 1 ? (0, $6ce94eb09701f53d$export$e9106be159f8c977)({
|
379
|
+
quantity: quantity,
|
380
|
+
config: config,
|
381
|
+
i18next: i18next
|
382
|
+
}) : config.fromFHIRQuantityUnitToString({
|
383
|
+
quantity: quantity,
|
384
|
+
language: config.language
|
385
|
+
});
|
386
|
+
// Concatenate all computed parts
|
387
|
+
// The space before is intentional so that numerator and denominator are well printed regardless of situation
|
388
|
+
return ` ${linkword} ${quantityText}`;
|
345
389
|
}
|
346
390
|
function $7895e9944cc835ce$export$fdc6e9cbd31555fb({ ratio: ratio, config: config, i18next: i18next }) {
|
347
391
|
// Extract params
|
348
392
|
const { denominator: denominator, numerator: numerator } = ratio;
|
349
|
-
// units as text
|
350
|
-
let numeratorUnit = $7895e9944cc835ce$var$hasUnit(numerator) ? config.fromFHIRQuantityUnitToString({
|
351
|
-
language: config.language,
|
352
|
-
quantity: numerator
|
353
|
-
}) : undefined;
|
354
|
-
let denominatorUnit = $7895e9944cc835ce$var$hasUnit(denominator) ? config.fromFHIRQuantityUnitToString({
|
355
|
-
language: config.language,
|
356
|
-
quantity: denominator
|
357
|
-
}) : undefined;
|
358
393
|
// quantity
|
359
394
|
let quantityNumerator = numerator?.value;
|
360
395
|
let quantityDenominator = denominator?.value;
|
361
396
|
// Collect results
|
362
397
|
const parts = [];
|
363
|
-
let noUnits = numeratorUnit === undefined && denominatorUnit === undefined;
|
364
|
-
let separator = noUnits ? "" : " ";
|
365
398
|
// Deal with numerator first
|
366
399
|
if (quantityNumerator !== undefined) {
|
367
|
-
|
368
|
-
const numeratorString =
|
369
|
-
|
370
|
-
|
400
|
+
// Reuse the quantity to string translation
|
401
|
+
const numeratorString = (0, $6ce94eb09701f53d$export$e9106be159f8c977)({
|
402
|
+
quantity: numerator,
|
403
|
+
config: config,
|
404
|
+
i18next: i18next
|
371
405
|
});
|
372
406
|
parts.push(numeratorString);
|
373
407
|
}
|
374
408
|
// Deal with denominator
|
375
409
|
if (quantityDenominator !== undefined) {
|
376
|
-
|
377
|
-
const denominatorString =
|
378
|
-
|
379
|
-
|
410
|
+
// Several cases exist for that, let use a proper function for that
|
411
|
+
const denominatorString = $7895e9944cc835ce$var$fromDenominatorToString({
|
412
|
+
config: config,
|
413
|
+
i18next: i18next,
|
414
|
+
quantity: denominator
|
380
415
|
});
|
381
416
|
parts.push(denominatorString);
|
382
417
|
}
|
383
418
|
// Concatenate the result
|
384
|
-
|
385
|
-
else return parts.join(separator);
|
419
|
+
return parts.length > 0 ? parts.join("") : undefined;
|
386
420
|
}
|
387
421
|
|
388
422
|
|
@@ -406,7 +440,7 @@ function $301791f33da707fa$export$b71cfd2510242de2({ dos: dos, config: config, i
|
|
406
440
|
|
407
441
|
function $e8251a88ed398f12$export$1d3efc96e203aa6b(dos) {
|
408
442
|
// If empty, return undefined
|
409
|
-
if (dos.timing
|
443
|
+
if (dos.timing?.repeat === undefined) return undefined;
|
410
444
|
return dos.timing.repeat;
|
411
445
|
}
|
412
446
|
|
@@ -421,7 +455,7 @@ function $1270a8f06113f53a$export$675ae45fa2875f4a({ dos: dos, i18next: i18next
|
|
421
455
|
let unit = repeat.durationUnit;
|
422
456
|
// Do nothing if no unit, I am not a wizard
|
423
457
|
if (unit === undefined) return undefined;
|
424
|
-
|
458
|
+
return [
|
425
459
|
// duration
|
426
460
|
duration !== undefined && i18next.t("fields.duration", {
|
427
461
|
durationText: i18next.t(`unitsOfTime:withCount.${unit}`, {
|
@@ -448,22 +482,20 @@ function $bc43734b944260d2$export$d663412e0c469ce2({ dos: dos, i18next: i18next
|
|
448
482
|
let max = repeat.frequencyMax;
|
449
483
|
// Do nothing if no frequency / frequencyMax, I am not a wizard
|
450
484
|
if (frequency === undefined && max === undefined) return undefined;
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
});
|
466
|
-
}
|
485
|
+
// Three cases
|
486
|
+
// 1. Frequency and frequencyMax are present
|
487
|
+
if (frequency !== undefined && max !== undefined) return i18next.t("fields.frequency.withfrequencyMax", {
|
488
|
+
count: max,
|
489
|
+
frequency: frequency
|
490
|
+
});
|
491
|
+
// 2. Only frequencyMax is present
|
492
|
+
if (max !== undefined) return i18next.t("fields.frequencyMax.frequencyMax", {
|
493
|
+
count: max
|
494
|
+
});
|
495
|
+
// 3. Only frequency is present
|
496
|
+
return i18next.t("fields.frequency.onlyFrequency", {
|
497
|
+
count: frequency
|
498
|
+
});
|
467
499
|
}
|
468
500
|
|
469
501
|
|
@@ -478,31 +510,29 @@ function $b9825dd9e0a2e687$export$aa31b783699f637({ dos: dos, i18next: i18next }
|
|
478
510
|
let unit = repeat.periodUnit;
|
479
511
|
// Do nothing if no unit, I am not a wizard
|
480
512
|
if (unit === undefined) return undefined;
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
});
|
505
|
-
}
|
513
|
+
// Three cases
|
514
|
+
// 1. period and periodMax are present
|
515
|
+
if (period !== undefined && max !== undefined) return i18next.t("fields.periodMax.withPeriod", {
|
516
|
+
period: period,
|
517
|
+
count: max,
|
518
|
+
unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
|
519
|
+
count: max
|
520
|
+
})
|
521
|
+
});
|
522
|
+
// 2. Only periodMax is present
|
523
|
+
if (max !== undefined) return i18next.t("fields.periodMax.onlyPeriodMax", {
|
524
|
+
count: max,
|
525
|
+
unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
|
526
|
+
count: max
|
527
|
+
})
|
528
|
+
});
|
529
|
+
// 3. Only period present
|
530
|
+
return i18next.t("fields.period.period", {
|
531
|
+
count: period,
|
532
|
+
unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
|
533
|
+
count: period
|
534
|
+
})
|
535
|
+
});
|
506
536
|
}
|
507
537
|
|
508
538
|
|
@@ -524,6 +554,7 @@ function $93b58b7d2ead3b95$export$826742c1df3eca39(i18next, arr, linkWord = "and
|
|
524
554
|
|
525
555
|
|
526
556
|
|
557
|
+
|
527
558
|
// Function to extract times
|
528
559
|
function $7a065f861a4b61f2$var$extractTime(minutes) {
|
529
560
|
let days = Math.floor(minutes / 1440);
|
@@ -560,11 +591,10 @@ function $7a065f861a4b61f2$var$transformOffset(i18next, offset) {
|
|
560
591
|
// Function to transform when[] into a string
|
561
592
|
function $7a065f861a4b61f2$var$transformWhen(i18next, when) {
|
562
593
|
// Only run when array is not empty
|
563
|
-
if (
|
594
|
+
if ((0, $7642ff4865ae4b0f$export$d9ff4a623e416a11)(when)) return undefined;
|
564
595
|
// Turn it into a string
|
565
596
|
const whens = when.map((whenCode)=>i18next.t(`eventTiming:${whenCode}`));
|
566
|
-
|
567
|
-
return finalString;
|
597
|
+
return (0, $93b58b7d2ead3b95$export$826742c1df3eca39)(i18next, whens);
|
568
598
|
}
|
569
599
|
function $7a065f861a4b61f2$export$433fa514f44031f3({ dos: dos, i18next: i18next }) {
|
570
600
|
let repeat = (0, $e8251a88ed398f12$export$1d3efc96e203aa6b)(dos);
|
@@ -587,6 +617,7 @@ function $7a065f861a4b61f2$export$433fa514f44031f3({ dos: dos, i18next: i18next
|
|
587
617
|
// Function
|
588
618
|
|
589
619
|
|
620
|
+
|
590
621
|
function $46f2142e76cf7e45$export$f6325e43097e9543({ dos: dos, i18next: i18next }) {
|
591
622
|
let repeat = (0, $e8251a88ed398f12$export$1d3efc96e203aa6b)(dos);
|
592
623
|
// If empty, return undefined
|
@@ -594,22 +625,21 @@ function $46f2142e76cf7e45$export$f6325e43097e9543({ dos: dos, i18next: i18next
|
|
594
625
|
// Pickup the repeat interesting attributes
|
595
626
|
let dayOfWeek = repeat.dayOfWeek;
|
596
627
|
// If empty, skip it
|
597
|
-
if (
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
});
|
606
|
-
}
|
628
|
+
if ((0, $7642ff4865ae4b0f$export$d9ff4a623e416a11)(dayOfWeek)) return undefined;
|
629
|
+
// Turn it into a string
|
630
|
+
const dayOfWeeks = dayOfWeek.map((dayCode)=>i18next.t(`daysOfWeek:${dayCode}`));
|
631
|
+
const dayOfWeeksAsString = (0, $93b58b7d2ead3b95$export$826742c1df3eca39)(i18next, dayOfWeeks);
|
632
|
+
return i18next.t("fields.dayOfWeek.dayOfWeek", {
|
633
|
+
count: dayOfWeek.length,
|
634
|
+
dayOfWeek: dayOfWeeksAsString
|
635
|
+
});
|
607
636
|
}
|
608
637
|
|
609
638
|
|
610
639
|
// Functions
|
611
640
|
|
612
641
|
|
642
|
+
|
613
643
|
/**
|
614
644
|
* time during the day, in the format hh:mm:ss (a subset of [ISO8601] icon).
|
615
645
|
* There is no date specified. Seconds must be provided due to schema type constraints but may be zero-filled
|
@@ -629,16 +659,14 @@ function $a846209a7dd119d4$export$ee205fa48981886d({ dos: dos, i18next: i18next
|
|
629
659
|
// Pickup the repeat interesting attributes
|
630
660
|
let timeOfDay = repeat.timeOfDay;
|
631
661
|
// If empty, skip it
|
632
|
-
if (
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
});
|
641
|
-
}
|
662
|
+
if ((0, $7642ff4865ae4b0f$export$d9ff4a623e416a11)(timeOfDay)) return undefined;
|
663
|
+
// Turn it into a string
|
664
|
+
const timeOfDays = timeOfDay.map($a846209a7dd119d4$var$formatString);
|
665
|
+
const timeOfDaysAsString = (0, $93b58b7d2ead3b95$export$826742c1df3eca39)(i18next, timeOfDays);
|
666
|
+
return i18next.t("fields.timeOfDay", {
|
667
|
+
timeOfDay: timeOfDaysAsString,
|
668
|
+
count: timeOfDays.length
|
669
|
+
});
|
642
670
|
}
|
643
671
|
|
644
672
|
|
@@ -665,12 +693,12 @@ function $ee04e2a8ed39962f$export$5c69a2202525487a({ dos: dos, config: config, i
|
|
665
693
|
if (codeableList.length > 0) return i18next.t("fields.asNeededFor", {
|
666
694
|
reasons: $ee04e2a8ed39962f$var$fromCodeableConceptArrayToString(i18next, codeableList, config)
|
667
695
|
});
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
696
|
+
// merge boolean to make it simpler
|
697
|
+
let booleanValue = [
|
698
|
+
asNeededBoolean,
|
699
|
+
asNeeded
|
700
|
+
].includes(true);
|
701
|
+
return booleanValue ? i18next.t("fields.asNeeded") : undefined;
|
674
702
|
}
|
675
703
|
|
676
704
|
|
@@ -702,12 +730,10 @@ function $9d632517596957df$export$b927a06bc51aea32({ dos: dos, config: config, i
|
|
702
730
|
let boundsDuration = repeat.boundsDuration;
|
703
731
|
// Do nothing if no boundsDuration, I am not a wizard
|
704
732
|
if (boundsDuration === undefined) return undefined;
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
});
|
710
|
-
}
|
733
|
+
let durationText = $9d632517596957df$var$transformDurationToString(i18next, boundsDuration, config);
|
734
|
+
return i18next.t("fields.boundsDuration", {
|
735
|
+
durationText: durationText
|
736
|
+
});
|
711
737
|
}
|
712
738
|
|
713
739
|
|
@@ -722,20 +748,18 @@ function $2da391a8a8345a3d$export$8c667cbf7bebaa93({ dos: dos, config: config, i
|
|
722
748
|
let boundsRange = repeat.boundsRange;
|
723
749
|
// Do nothing if no boundsRange, I am not a wizard
|
724
750
|
if (boundsRange === undefined) return undefined;
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
});
|
738
|
-
}
|
751
|
+
// Turn range into a text
|
752
|
+
const rangeText = (0, $9ee880701f47723b$export$be17d167ed50d870)({
|
753
|
+
range: boundsRange,
|
754
|
+
config: config,
|
755
|
+
i18next: i18next
|
756
|
+
});
|
757
|
+
// Reject if empty
|
758
|
+
if (rangeText === undefined) return undefined;
|
759
|
+
// return the final string
|
760
|
+
return i18next.t("fields.boundsRange", {
|
761
|
+
rangeText: rangeText
|
762
|
+
});
|
739
763
|
}
|
740
764
|
|
741
765
|
|
@@ -749,22 +773,20 @@ function $39470eb799331038$export$498ca7f558a02e67({ dos: dos, i18next: i18next
|
|
749
773
|
let countMax = repeat.countMax;
|
750
774
|
// Do nothing if no count, I am not a wizard
|
751
775
|
if (count === undefined && countMax === undefined) return undefined;
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
});
|
767
|
-
}
|
776
|
+
// Three cases
|
777
|
+
// 1. Both count & countMax are present
|
778
|
+
if (count !== undefined && countMax !== undefined) return i18next.t("fields.countMax.countMax", {
|
779
|
+
count: countMax,
|
780
|
+
low: count
|
781
|
+
});
|
782
|
+
// 2. Only countMax is present
|
783
|
+
if (countMax !== undefined) return i18next.t("fields.count.count", {
|
784
|
+
count: countMax
|
785
|
+
});
|
786
|
+
// 3. Only count is present
|
787
|
+
return i18next.t("fields.count.count", {
|
788
|
+
count: count
|
789
|
+
});
|
768
790
|
}
|
769
791
|
|
770
792
|
|
@@ -775,19 +797,32 @@ function $39470eb799331038$export$498ca7f558a02e67({ dos: dos, i18next: i18next
|
|
775
797
|
// Note: dateStyle and timeStyle can be used with each other,
|
776
798
|
// but not with other date-time component options (e.g. weekday, hour, month, etc.).
|
777
799
|
function $208be5279f5e6c65$var$generateDateStyleFormatOptions(options) {
|
800
|
+
if (options.dateStyle !== undefined) return {
|
801
|
+
dateStyle: options.dateStyle
|
802
|
+
};
|
803
|
+
const defaults = {
|
804
|
+
year: "numeric",
|
805
|
+
month: "2-digit",
|
806
|
+
day: "2-digit"
|
807
|
+
};
|
778
808
|
return {
|
779
|
-
|
780
|
-
|
781
|
-
day: options.dateStyle === undefined ? options.day || "2-digit" : undefined,
|
782
|
-
weekday: options.dateStyle === undefined ? options.weekday : undefined
|
809
|
+
...options,
|
810
|
+
...defaults
|
783
811
|
};
|
784
812
|
}
|
785
813
|
// Function to clean up the params for timeStyle situation
|
786
814
|
function $208be5279f5e6c65$var$generateTimeStyleFormatOptions(options) {
|
815
|
+
if (options.timeStyle !== undefined) return {
|
816
|
+
timeStyle: options.timeStyle
|
817
|
+
};
|
818
|
+
const defaults = {
|
819
|
+
hour: "2-digit",
|
820
|
+
minute: "2-digit",
|
821
|
+
second: "2-digit"
|
822
|
+
};
|
787
823
|
return {
|
788
|
-
|
789
|
-
|
790
|
-
second: options.timeStyle === undefined ? options.second || "2-digit" : undefined
|
824
|
+
...options,
|
825
|
+
...defaults
|
791
826
|
};
|
792
827
|
}
|
793
828
|
function $208be5279f5e6c65$export$a77f8869772ffca4({ config: config, datetimes: datetimes }) {
|
@@ -829,8 +864,7 @@ function $208be5279f5e6c65$export$a77f8869772ffca4({ config: config, datetimes:
|
|
829
864
|
if (!hasTimePart) {
|
830
865
|
let df3 = new Intl.DateTimeFormat(config.language, {
|
831
866
|
// retrieve value from user
|
832
|
-
dateStyle
|
833
|
-
// fallback if dateStyle is not defined
|
867
|
+
// and fallback if dateStyle is not defined
|
834
868
|
...$208be5279f5e6c65$var$generateDateStyleFormatOptions(options)
|
835
869
|
});
|
836
870
|
return df3.format(date);
|
@@ -838,9 +872,7 @@ function $208be5279f5e6c65$export$a77f8869772ffca4({ config: config, datetimes:
|
|
838
872
|
// Otherwise, we have a full datetime
|
839
873
|
let df4 = new Intl.DateTimeFormat(config.language, {
|
840
874
|
// retrieve value from user
|
841
|
-
dateStyle
|
842
|
-
timeStyle: options.timeStyle,
|
843
|
-
// fallback if dateStyle / timeStyle is not defined
|
875
|
+
// and fallback if dateStyle / timeStyle is not defined
|
844
876
|
...$208be5279f5e6c65$var$generateDateStyleFormatOptions(options),
|
845
877
|
...$208be5279f5e6c65$var$generateTimeStyleFormatOptions(options)
|
846
878
|
});
|
@@ -862,11 +894,11 @@ function $208be5279f5e6c65$export$4699e913d5b6ffeb({ config: config, datetime: d
|
|
862
894
|
}
|
863
895
|
|
864
896
|
|
897
|
+
|
865
898
|
function $3bceb6a4d7bec96e$export$3c2848bc0f0e3783({ dos: dos, config: config, i18next: i18next }) {
|
866
899
|
// If empty, return undefined
|
867
|
-
|
868
|
-
|
869
|
-
let events = dos.timing.event;
|
900
|
+
let events = dos.timing?.event;
|
901
|
+
if ((0, $7642ff4865ae4b0f$export$d9ff4a623e416a11)(events)) return undefined;
|
870
902
|
// List to string
|
871
903
|
let eventList = (0, $208be5279f5e6c65$export$a77f8869772ffca4)({
|
872
904
|
config: config,
|
@@ -882,9 +914,10 @@ function $3bceb6a4d7bec96e$export$3c2848bc0f0e3783({ dos: dos, config: config, i
|
|
882
914
|
|
883
915
|
// Function
|
884
916
|
|
917
|
+
|
885
918
|
function $6c156f35df44ca41$export$21e3522d6e713036({ dos: dos, config: config, i18next: i18next }) {
|
886
919
|
// If empty, return undefined
|
887
|
-
if (
|
920
|
+
if ((0, $7642ff4865ae4b0f$export$d9ff4a623e416a11)(dos.additionalInstruction)) return undefined;
|
888
921
|
// Turn it into strings
|
889
922
|
let additionalInstructions = dos.additionalInstruction.map((instruction)=>config.fromCodeableConceptToString({
|
890
923
|
code: instruction,
|
@@ -930,7 +963,7 @@ function $9ad44f2c84a9bdf4$export$58c8a9e040283a66({ dos: dos, config: config, i
|
|
930
963
|
|
931
964
|
function $45256d2a188dcbd7$export$75a89431d80a701a({ dos: dos, config: config, i18next: i18next }) {
|
932
965
|
// If empty, return undefined
|
933
|
-
if (dos.timing
|
966
|
+
if (dos.timing?.repeat?.boundsPeriod === undefined) return undefined;
|
934
967
|
// Generate the string version of them
|
935
968
|
const boundsPeriod = dos.timing.repeat.boundsPeriod;
|
936
969
|
let start = (0, $208be5279f5e6c65$export$4699e913d5b6ffeb)({
|