fhir-dosage-utils 1.9.0 → 1.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/module.js CHANGED
@@ -13,22 +13,30 @@ function $a620268c8b5a46fd$export$b1a6aed91fad1636({ quantity: quantity }) {
13
13
  }
14
14
 
15
15
 
16
+ // Functions
17
+ function $1c8530b981ded822$export$d9ff4a623e416a11(array) {
18
+ return array === undefined || array.length === 0;
19
+ }
20
+
21
+
16
22
  function $f2878500cc217687$export$f478f96b98da13a4({ code: code }) {
17
23
  // If no code, skip it
18
24
  if (code === undefined) return undefined;
19
25
  // Take text first
20
26
  if (code.text !== undefined) return code.text;
21
27
  // If empty, skip it
22
- if (code.coding === undefined || code.coding.length === 0) return undefined;
28
+ if ((0, $1c8530b981ded822$export$d9ff4a623e416a11)(code.coding)) return undefined;
23
29
  // Take first coding; display first then code
24
30
  let firstCode = code.coding[0];
25
31
  return firstCode.display || firstCode.code;
26
32
  }
27
33
 
28
34
 
35
+ // Functions
36
+
29
37
  function $a31aaee21175037d$export$30c337e25ab8e95b({ extensions: extensions }) {
30
38
  // If no extensions, skip it
31
- if (extensions === undefined || extensions.length === 0) return undefined;
39
+ if ((0, $1c8530b981ded822$export$d9ff4a623e416a11)(extensions)) return undefined;
32
40
  // KIS implementation : print it as provided, without doing anything
33
41
  // Extensions have so many cases btw, that having a basic function does the trick
34
42
  return extensions.map((extension)=>JSON.stringify(extension)).join(" ");
@@ -91,7 +99,8 @@ class $2422495f2648c580$export$f807d9a22ff8372d {
91
99
  "common",
92
100
  "daysOfWeek",
93
101
  "eventTiming",
94
- "unitsOfTime"
102
+ "unitsOfTime",
103
+ "quantityComparator"
95
104
  ],
96
105
  defaultNS: "common",
97
106
  // attributes set by user
@@ -190,13 +199,19 @@ function $2f3f5b2132f3c88a$export$e9106be159f8c977({ quantity: quantity, config:
190
199
  });
191
200
  let value = quantity.value || 1;
192
201
  // If no unit is present (in other words ""), we don't put it
193
- if (unit.length === 0) return i18next.t("amount.quantity.withoutUnit", {
202
+ let quantityString = unit.length === 0 ? i18next.t("amount.quantity.withoutUnit", {
194
203
  quantity: value
195
- });
196
- else return i18next.t("amount.quantity.withUnit", {
204
+ }) : i18next.t("amount.quantity.withUnit", {
197
205
  quantity: value,
198
206
  unit: unit
199
207
  });
208
+ // Compute the comparator
209
+ let comparatorCode = quantity.comparator;
210
+ let comparatorString = comparatorCode !== undefined ? i18next.t(`quantityComparator:${comparatorCode}`) : undefined;
211
+ // If no comparator, print it
212
+ if (comparatorString === undefined) return quantityString;
213
+ else // concatenate comparator and quantity
214
+ return `${comparatorString} ${quantityString}`;
200
215
  }
201
216
 
202
217
 
@@ -225,7 +240,8 @@ function $73073500f7f08f16$var$transformQuantityUnitToString(i18next, quantity,
225
240
  return i18next.t(`unitsOfTime:withoutCount.${code}`, {
226
241
  count: quantityValue
227
242
  });
228
- } else // otherwise, it is UCUM, ... so let the user do the job
243
+ }
244
+ // otherwise, it is UCUM, ... so let the user do the job
229
245
  return config.fromFHIRQuantityUnitToString({
230
246
  language: config.language,
231
247
  quantity: quantity
@@ -323,50 +339,68 @@ function $09db039855b6d015$export$d3dd7d3522271dba({ dos: dos, config: config, i
323
339
  }
324
340
 
325
341
 
342
+ // Functions
343
+
326
344
  // Quantity has an unit ?
327
345
  function $eb371feb739abc89$var$hasUnit(quantity) {
328
- return (quantity?.unit || quantity?.code) !== undefined;
346
+ return [
347
+ quantity?.unit,
348
+ quantity?.code
349
+ ].some((field)=>field !== undefined);
350
+ }
351
+ // To cover all nasty cases of denominator
352
+ function $eb371feb739abc89$var$fromDenominatorToString({ config: config, i18next: i18next, quantity: quantity }) {
353
+ let hasUnitDenominator = $eb371feb739abc89$var$hasUnit(quantity);
354
+ let value = quantity.value;
355
+ // If no unit, it is quite simple
356
+ if (!hasUnitDenominator) return `:${value}`;
357
+ // Get correct linkword (depending of the quantity value)
358
+ let linkword = i18next.t("amount.ratio.denominatorLinkword", {
359
+ count: value
360
+ });
361
+ // Get quantity text (depending of the quantity value)
362
+ let quantityText = value !== 1 ? (0, $2f3f5b2132f3c88a$export$e9106be159f8c977)({
363
+ quantity: quantity,
364
+ config: config,
365
+ i18next: i18next
366
+ }) : config.fromFHIRQuantityUnitToString({
367
+ quantity: quantity,
368
+ language: config.language
369
+ });
370
+ // Concatenate all computed parts
371
+ // The space before is intentional so that numerator and denominator are well printed regardless of situation
372
+ return ` ${linkword} ${quantityText}`;
329
373
  }
330
374
  function $eb371feb739abc89$export$fdc6e9cbd31555fb({ ratio: ratio, config: config, i18next: i18next }) {
331
375
  // Extract params
332
376
  const { denominator: denominator, numerator: numerator } = ratio;
333
- // units as text
334
- let numeratorUnit = $eb371feb739abc89$var$hasUnit(numerator) ? config.fromFHIRQuantityUnitToString({
335
- language: config.language,
336
- quantity: numerator
337
- }) : undefined;
338
- let denominatorUnit = $eb371feb739abc89$var$hasUnit(denominator) ? config.fromFHIRQuantityUnitToString({
339
- language: config.language,
340
- quantity: denominator
341
- }) : undefined;
342
377
  // quantity
343
378
  let quantityNumerator = numerator?.value;
344
379
  let quantityDenominator = denominator?.value;
345
380
  // Collect results
346
381
  const parts = [];
347
- let noUnits = numeratorUnit === undefined && denominatorUnit === undefined;
348
- let separator = noUnits ? "" : " ";
349
382
  // Deal with numerator first
350
383
  if (quantityNumerator !== undefined) {
351
- let technicalKey = numeratorUnit !== undefined ? "withUnit" : "withoutUnit";
352
- const numeratorString = i18next.t(`amount.ratio.${technicalKey}.numerator`, {
353
- count: quantityNumerator,
354
- numeratorUnit: numeratorUnit
384
+ // Reuse the quantity to string translation
385
+ const numeratorString = (0, $2f3f5b2132f3c88a$export$e9106be159f8c977)({
386
+ quantity: numerator,
387
+ config: config,
388
+ i18next: i18next
355
389
  });
356
390
  parts.push(numeratorString);
357
391
  }
358
392
  // Deal with denominator
359
393
  if (quantityDenominator !== undefined) {
360
- let technicalKey = denominatorUnit !== undefined ? "withUnit" : "withoutUnit";
361
- const denominatorString = i18next.t(`amount.ratio.${technicalKey}.denominator`, {
362
- count: quantityDenominator,
363
- denominatorUnit: denominatorUnit
394
+ // Several cases exist for that, let use a proper function for that
395
+ const denominatorString = $eb371feb739abc89$var$fromDenominatorToString({
396
+ config: config,
397
+ i18next: i18next,
398
+ quantity: denominator
364
399
  });
365
400
  parts.push(denominatorString);
366
401
  }
367
402
  // Concatenate the result
368
- if (parts.length === 0) return undefined;
369
- else return parts.join(separator);
403
+ return parts.length > 0 ? parts.join("") : undefined;
370
404
  }
371
405
 
372
406
 
@@ -390,7 +424,7 @@ function $520e93a43a731e9b$export$b71cfd2510242de2({ dos: dos, config: config, i
390
424
 
391
425
  function $23009b94f0a4a8ee$export$1d3efc96e203aa6b(dos) {
392
426
  // If empty, return undefined
393
- if (dos.timing === undefined || dos.timing.repeat === undefined) return undefined;
427
+ if (dos.timing?.repeat === undefined) return undefined;
394
428
  return dos.timing.repeat;
395
429
  }
396
430
 
@@ -405,7 +439,7 @@ function $9b80fa365533c8a7$export$675ae45fa2875f4a({ dos: dos, i18next: i18next
405
439
  let unit = repeat.durationUnit;
406
440
  // Do nothing if no unit, I am not a wizard
407
441
  if (unit === undefined) return undefined;
408
- else return [
442
+ return [
409
443
  // duration
410
444
  duration !== undefined && i18next.t("fields.duration", {
411
445
  durationText: i18next.t(`unitsOfTime:withCount.${unit}`, {
@@ -432,22 +466,20 @@ function $7e1bdc5bf5cdf5bd$export$d663412e0c469ce2({ dos: dos, i18next: i18next
432
466
  let max = repeat.frequencyMax;
433
467
  // Do nothing if no frequency / frequencyMax, I am not a wizard
434
468
  if (frequency === undefined && max === undefined) return undefined;
435
- else {
436
- // Three cases
437
- // 1. Frequency and frequencyMax are present
438
- if (frequency !== undefined && max !== undefined) return i18next.t("fields.frequency.withfrequencyMax", {
439
- count: max,
440
- frequency: frequency
441
- });
442
- // 2. Only frequencyMax is present
443
- if (max !== undefined) return i18next.t("fields.frequencyMax.frequencyMax", {
444
- count: max
445
- });
446
- // 3. Only frequency is present
447
- return i18next.t("fields.frequency.onlyFrequency", {
448
- count: frequency
449
- });
450
- }
469
+ // Three cases
470
+ // 1. Frequency and frequencyMax are present
471
+ if (frequency !== undefined && max !== undefined) return i18next.t("fields.frequency.withfrequencyMax", {
472
+ count: max,
473
+ frequency: frequency
474
+ });
475
+ // 2. Only frequencyMax is present
476
+ if (max !== undefined) return i18next.t("fields.frequencyMax.frequencyMax", {
477
+ count: max
478
+ });
479
+ // 3. Only frequency is present
480
+ return i18next.t("fields.frequency.onlyFrequency", {
481
+ count: frequency
482
+ });
451
483
  }
452
484
 
453
485
 
@@ -462,31 +494,29 @@ function $fcc6c325de921010$export$aa31b783699f637({ dos: dos, i18next: i18next }
462
494
  let unit = repeat.periodUnit;
463
495
  // Do nothing if no unit, I am not a wizard
464
496
  if (unit === undefined) return undefined;
465
- else {
466
- // Three cases
467
- // 1. period and periodMax are present
468
- if (period !== undefined && max !== undefined) return i18next.t("fields.periodMax.withPeriod", {
469
- period: period,
470
- count: max,
471
- unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
472
- count: max
473
- })
474
- });
475
- // 2. Only periodMax is present
476
- if (max !== undefined) return i18next.t("fields.periodMax.onlyPeriodMax", {
477
- count: max,
478
- unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
479
- count: max
480
- })
481
- });
482
- // 3. Only period present
483
- return i18next.t("fields.period.period", {
484
- count: period,
485
- unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
486
- count: period
487
- })
488
- });
489
- }
497
+ // Three cases
498
+ // 1. period and periodMax are present
499
+ if (period !== undefined && max !== undefined) return i18next.t("fields.periodMax.withPeriod", {
500
+ period: period,
501
+ count: max,
502
+ unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
503
+ count: max
504
+ })
505
+ });
506
+ // 2. Only periodMax is present
507
+ if (max !== undefined) return i18next.t("fields.periodMax.onlyPeriodMax", {
508
+ count: max,
509
+ unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
510
+ count: max
511
+ })
512
+ });
513
+ // 3. Only period present
514
+ return i18next.t("fields.period.period", {
515
+ count: period,
516
+ unit: i18next.t(`unitsOfTime:withoutCount.${unit}`, {
517
+ count: period
518
+ })
519
+ });
490
520
  }
491
521
 
492
522
 
@@ -508,6 +538,7 @@ function $f475af73bad0ba43$export$826742c1df3eca39(i18next, arr, linkWord = "and
508
538
 
509
539
 
510
540
 
541
+
511
542
  // Function to extract times
512
543
  function $f88800def2ddd9e9$var$extractTime(minutes) {
513
544
  let days = Math.floor(minutes / 1440);
@@ -544,11 +575,10 @@ function $f88800def2ddd9e9$var$transformOffset(i18next, offset) {
544
575
  // Function to transform when[] into a string
545
576
  function $f88800def2ddd9e9$var$transformWhen(i18next, when) {
546
577
  // Only run when array is not empty
547
- if (when === undefined || when.length === 0) return undefined;
578
+ if ((0, $1c8530b981ded822$export$d9ff4a623e416a11)(when)) return undefined;
548
579
  // Turn it into a string
549
580
  const whens = when.map((whenCode)=>i18next.t(`eventTiming:${whenCode}`));
550
- const finalString = (0, $f475af73bad0ba43$export$826742c1df3eca39)(i18next, whens);
551
- return finalString;
581
+ return (0, $f475af73bad0ba43$export$826742c1df3eca39)(i18next, whens);
552
582
  }
553
583
  function $f88800def2ddd9e9$export$433fa514f44031f3({ dos: dos, i18next: i18next }) {
554
584
  let repeat = (0, $23009b94f0a4a8ee$export$1d3efc96e203aa6b)(dos);
@@ -571,6 +601,7 @@ function $f88800def2ddd9e9$export$433fa514f44031f3({ dos: dos, i18next: i18next
571
601
  // Function
572
602
 
573
603
 
604
+
574
605
  function $80e4a0390d11feb3$export$f6325e43097e9543({ dos: dos, i18next: i18next }) {
575
606
  let repeat = (0, $23009b94f0a4a8ee$export$1d3efc96e203aa6b)(dos);
576
607
  // If empty, return undefined
@@ -578,22 +609,21 @@ function $80e4a0390d11feb3$export$f6325e43097e9543({ dos: dos, i18next: i18next
578
609
  // Pickup the repeat interesting attributes
579
610
  let dayOfWeek = repeat.dayOfWeek;
580
611
  // If empty, skip it
581
- if (dayOfWeek === undefined || dayOfWeek.length === 0) return undefined;
582
- else {
583
- // Turn it into a string
584
- const dayOfWeeks = dayOfWeek.map((dayCode)=>i18next.t(`daysOfWeek:${dayCode}`));
585
- const dayOfWeeksAsString = (0, $f475af73bad0ba43$export$826742c1df3eca39)(i18next, dayOfWeeks);
586
- return i18next.t("fields.dayOfWeek.dayOfWeek", {
587
- count: dayOfWeek.length,
588
- dayOfWeek: dayOfWeeksAsString
589
- });
590
- }
612
+ if ((0, $1c8530b981ded822$export$d9ff4a623e416a11)(dayOfWeek)) return undefined;
613
+ // Turn it into a string
614
+ const dayOfWeeks = dayOfWeek.map((dayCode)=>i18next.t(`daysOfWeek:${dayCode}`));
615
+ const dayOfWeeksAsString = (0, $f475af73bad0ba43$export$826742c1df3eca39)(i18next, dayOfWeeks);
616
+ return i18next.t("fields.dayOfWeek.dayOfWeek", {
617
+ count: dayOfWeek.length,
618
+ dayOfWeek: dayOfWeeksAsString
619
+ });
591
620
  }
592
621
 
593
622
 
594
623
  // Functions
595
624
 
596
625
 
626
+
597
627
  /**
598
628
  * time during the day, in the format hh:mm:ss (a subset of [ISO8601] icon).
599
629
  * There is no date specified. Seconds must be provided due to schema type constraints but may be zero-filled
@@ -613,16 +643,14 @@ function $a1b58a85293e76cc$export$ee205fa48981886d({ dos: dos, i18next: i18next
613
643
  // Pickup the repeat interesting attributes
614
644
  let timeOfDay = repeat.timeOfDay;
615
645
  // If empty, skip it
616
- if (timeOfDay === undefined || timeOfDay.length === 0) return undefined;
617
- else {
618
- // Turn it into a string
619
- const timeOfDays = timeOfDay.map($a1b58a85293e76cc$var$formatString);
620
- const timeOfDaysAsString = (0, $f475af73bad0ba43$export$826742c1df3eca39)(i18next, timeOfDays);
621
- return i18next.t("fields.timeOfDay", {
622
- timeOfDay: timeOfDaysAsString,
623
- count: timeOfDays.length
624
- });
625
- }
646
+ if ((0, $1c8530b981ded822$export$d9ff4a623e416a11)(timeOfDay)) return undefined;
647
+ // Turn it into a string
648
+ const timeOfDays = timeOfDay.map($a1b58a85293e76cc$var$formatString);
649
+ const timeOfDaysAsString = (0, $f475af73bad0ba43$export$826742c1df3eca39)(i18next, timeOfDays);
650
+ return i18next.t("fields.timeOfDay", {
651
+ timeOfDay: timeOfDaysAsString,
652
+ count: timeOfDays.length
653
+ });
626
654
  }
627
655
 
628
656
 
@@ -649,12 +677,12 @@ function $ab507771e2827c53$export$5c69a2202525487a({ dos: dos, config: config, i
649
677
  if (codeableList.length > 0) return i18next.t("fields.asNeededFor", {
650
678
  reasons: $ab507771e2827c53$var$fromCodeableConceptArrayToString(i18next, codeableList, config)
651
679
  });
652
- else {
653
- // merge boolean to make it simpler
654
- let booleanValue = asNeededBoolean || asNeeded || false;
655
- if (booleanValue) return i18next.t("fields.asNeeded");
656
- else return undefined;
657
- }
680
+ // merge boolean to make it simpler
681
+ let booleanValue = [
682
+ asNeededBoolean,
683
+ asNeeded
684
+ ].includes(true);
685
+ return booleanValue ? i18next.t("fields.asNeeded") : undefined;
658
686
  }
659
687
 
660
688
 
@@ -686,12 +714,10 @@ function $ac69a26e361175ba$export$b927a06bc51aea32({ dos: dos, config: config, i
686
714
  let boundsDuration = repeat.boundsDuration;
687
715
  // Do nothing if no boundsDuration, I am not a wizard
688
716
  if (boundsDuration === undefined) return undefined;
689
- else {
690
- let durationText = $ac69a26e361175ba$var$transformDurationToString(i18next, boundsDuration, config);
691
- return i18next.t("fields.boundsDuration", {
692
- durationText: durationText
693
- });
694
- }
717
+ let durationText = $ac69a26e361175ba$var$transformDurationToString(i18next, boundsDuration, config);
718
+ return i18next.t("fields.boundsDuration", {
719
+ durationText: durationText
720
+ });
695
721
  }
696
722
 
697
723
 
@@ -706,20 +732,18 @@ function $6b27b297c2af1001$export$8c667cbf7bebaa93({ dos: dos, config: config, i
706
732
  let boundsRange = repeat.boundsRange;
707
733
  // Do nothing if no boundsRange, I am not a wizard
708
734
  if (boundsRange === undefined) return undefined;
709
- else {
710
- // Turn range into a text
711
- const rangeText = (0, $73073500f7f08f16$export$be17d167ed50d870)({
712
- range: boundsRange,
713
- config: config,
714
- i18next: i18next
715
- });
716
- // Reject if empty
717
- if (rangeText === undefined) return undefined;
718
- // return the final string
719
- return i18next.t("fields.boundsRange", {
720
- rangeText: rangeText
721
- });
722
- }
735
+ // Turn range into a text
736
+ const rangeText = (0, $73073500f7f08f16$export$be17d167ed50d870)({
737
+ range: boundsRange,
738
+ config: config,
739
+ i18next: i18next
740
+ });
741
+ // Reject if empty
742
+ if (rangeText === undefined) return undefined;
743
+ // return the final string
744
+ return i18next.t("fields.boundsRange", {
745
+ rangeText: rangeText
746
+ });
723
747
  }
724
748
 
725
749
 
@@ -733,22 +757,20 @@ function $73a945b97fd1a22f$export$498ca7f558a02e67({ dos: dos, i18next: i18next
733
757
  let countMax = repeat.countMax;
734
758
  // Do nothing if no count, I am not a wizard
735
759
  if (count === undefined && countMax === undefined) return undefined;
736
- else {
737
- // Three cases
738
- // 1. Both count & countMax are present
739
- if (count !== undefined && countMax !== undefined) return i18next.t("fields.countMax.countMax", {
740
- count: countMax,
741
- low: count
742
- });
743
- // 2. Only countMax is present
744
- if (countMax !== undefined) return i18next.t("fields.count.count", {
745
- count: countMax
746
- });
747
- // 3. Only count is present
748
- return i18next.t("fields.count.count", {
749
- count: count
750
- });
751
- }
760
+ // Three cases
761
+ // 1. Both count & countMax are present
762
+ if (count !== undefined && countMax !== undefined) return i18next.t("fields.countMax.countMax", {
763
+ count: countMax,
764
+ low: count
765
+ });
766
+ // 2. Only countMax is present
767
+ if (countMax !== undefined) return i18next.t("fields.count.count", {
768
+ count: countMax
769
+ });
770
+ // 3. Only count is present
771
+ return i18next.t("fields.count.count", {
772
+ count: count
773
+ });
752
774
  }
753
775
 
754
776
 
@@ -759,19 +781,32 @@ function $73a945b97fd1a22f$export$498ca7f558a02e67({ dos: dos, i18next: i18next
759
781
  // Note: dateStyle and timeStyle can be used with each other,
760
782
  // but not with other date-time component options (e.g. weekday, hour, month, etc.).
761
783
  function $d3afe3c00981fd78$var$generateDateStyleFormatOptions(options) {
784
+ if (options.dateStyle !== undefined) return {
785
+ dateStyle: options.dateStyle
786
+ };
787
+ const defaults = {
788
+ year: "numeric",
789
+ month: "2-digit",
790
+ day: "2-digit"
791
+ };
762
792
  return {
763
- year: options.dateStyle === undefined ? options.year || "numeric" : undefined,
764
- month: options.dateStyle === undefined ? options.month || "2-digit" : undefined,
765
- day: options.dateStyle === undefined ? options.day || "2-digit" : undefined,
766
- weekday: options.dateStyle === undefined ? options.weekday : undefined
793
+ ...options,
794
+ ...defaults
767
795
  };
768
796
  }
769
797
  // Function to clean up the params for timeStyle situation
770
798
  function $d3afe3c00981fd78$var$generateTimeStyleFormatOptions(options) {
799
+ if (options.timeStyle !== undefined) return {
800
+ timeStyle: options.timeStyle
801
+ };
802
+ const defaults = {
803
+ hour: "2-digit",
804
+ minute: "2-digit",
805
+ second: "2-digit"
806
+ };
771
807
  return {
772
- hour: options.timeStyle === undefined ? options.hour || "2-digit" : undefined,
773
- minute: options.timeStyle === undefined ? options.minute || "2-digit" : undefined,
774
- second: options.timeStyle === undefined ? options.second || "2-digit" : undefined
808
+ ...options,
809
+ ...defaults
775
810
  };
776
811
  }
777
812
  function $d3afe3c00981fd78$export$a77f8869772ffca4({ config: config, datetimes: datetimes }) {
@@ -813,8 +848,7 @@ function $d3afe3c00981fd78$export$a77f8869772ffca4({ config: config, datetimes:
813
848
  if (!hasTimePart) {
814
849
  let df3 = new Intl.DateTimeFormat(config.language, {
815
850
  // retrieve value from user
816
- dateStyle: options.dateStyle,
817
- // fallback if dateStyle is not defined
851
+ // and fallback if dateStyle is not defined
818
852
  ...$d3afe3c00981fd78$var$generateDateStyleFormatOptions(options)
819
853
  });
820
854
  return df3.format(date);
@@ -822,9 +856,7 @@ function $d3afe3c00981fd78$export$a77f8869772ffca4({ config: config, datetimes:
822
856
  // Otherwise, we have a full datetime
823
857
  let df4 = new Intl.DateTimeFormat(config.language, {
824
858
  // retrieve value from user
825
- dateStyle: options.dateStyle,
826
- timeStyle: options.timeStyle,
827
- // fallback if dateStyle / timeStyle is not defined
859
+ // and fallback if dateStyle / timeStyle is not defined
828
860
  ...$d3afe3c00981fd78$var$generateDateStyleFormatOptions(options),
829
861
  ...$d3afe3c00981fd78$var$generateTimeStyleFormatOptions(options)
830
862
  });
@@ -846,11 +878,11 @@ function $d3afe3c00981fd78$export$4699e913d5b6ffeb({ config: config, datetime: d
846
878
  }
847
879
 
848
880
 
881
+
849
882
  function $5f0331fa51f3283d$export$3c2848bc0f0e3783({ dos: dos, config: config, i18next: i18next }) {
850
883
  // If empty, return undefined
851
- if (dos.timing === undefined || dos.timing.event === undefined || dos.timing.event.length === 0) return undefined;
852
- // Generate the string version of them
853
- let events = dos.timing.event;
884
+ let events = dos.timing?.event;
885
+ if ((0, $1c8530b981ded822$export$d9ff4a623e416a11)(events)) return undefined;
854
886
  // List to string
855
887
  let eventList = (0, $d3afe3c00981fd78$export$a77f8869772ffca4)({
856
888
  config: config,
@@ -866,9 +898,10 @@ function $5f0331fa51f3283d$export$3c2848bc0f0e3783({ dos: dos, config: config, i
866
898
 
867
899
  // Function
868
900
 
901
+
869
902
  function $f40067ed55113d89$export$21e3522d6e713036({ dos: dos, config: config, i18next: i18next }) {
870
903
  // If empty, return undefined
871
- if (dos.additionalInstruction === undefined || dos.additionalInstruction.length === 0) return undefined;
904
+ if ((0, $1c8530b981ded822$export$d9ff4a623e416a11)(dos.additionalInstruction)) return undefined;
872
905
  // Turn it into strings
873
906
  let additionalInstructions = dos.additionalInstruction.map((instruction)=>config.fromCodeableConceptToString({
874
907
  code: instruction,
@@ -914,7 +947,7 @@ function $e372e1d4df385570$export$58c8a9e040283a66({ dos: dos, config: config, i
914
947
 
915
948
  function $f28938e27e1e9773$export$75a89431d80a701a({ dos: dos, config: config, i18next: i18next }) {
916
949
  // If empty, return undefined
917
- if (dos.timing === undefined || dos.timing.repeat === undefined || dos.timing.repeat.boundsPeriod === undefined) return undefined;
950
+ if (dos.timing?.repeat?.boundsPeriod === undefined) return undefined;
918
951
  // Generate the string version of them
919
952
  const boundsPeriod = dos.timing.repeat.boundsPeriod;
920
953
  let start = (0, $d3afe3c00981fd78$export$4699e913d5b6ffeb)({