@d4l/collect-lib 1.9.0 → 1.10.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/index.d.mts CHANGED
@@ -249,7 +249,7 @@ type ProgramContent = {
249
249
  title: TranslatedString;
250
250
  description: TranslatedString;
251
251
  contact: TranslatedString;
252
- contactInfo: ProgramContact;
252
+ contactInfo?: ProgramContact;
253
253
  image?: string;
254
254
  institute?: {
255
255
  name?: TranslatedString;
@@ -525,7 +525,7 @@ type RecursiveKeyOf<TObj extends object> = {
525
525
  type RecursiveKeyOfInner<TObj extends object> = {
526
526
  [TKey in keyof TObj & (string | number)]: RecursiveKeyOfHandleValue<TObj[TKey], `.${TKey}`>;
527
527
  }[keyof TObj & (string | number)];
528
- type RecursiveKeyOfHandleValue<TValue, Text extends string> = TValue extends any[] ? Text : TValue extends object ? Text | `${Text}${RecursiveKeyOfInner<TValue>}` : Text;
528
+ type RecursiveKeyOfHandleValue<TValue, Text extends string> = TValue extends Function ? undefined : TValue extends any[] ? Text | `${Text}.${number}` | `${Text}.${number}${RecursiveKeyOfInner<TValue[0]>}` : TValue extends object ? Text | `${Text}${RecursiveKeyOfInner<TValue>}` : Text;
529
529
 
530
530
  declare function toDeviceConfig(devices: ProgramDevice[]): DeviceConfig[];
531
531
 
package/dist/index.d.ts CHANGED
@@ -249,7 +249,7 @@ type ProgramContent = {
249
249
  title: TranslatedString;
250
250
  description: TranslatedString;
251
251
  contact: TranslatedString;
252
- contactInfo: ProgramContact;
252
+ contactInfo?: ProgramContact;
253
253
  image?: string;
254
254
  institute?: {
255
255
  name?: TranslatedString;
@@ -525,7 +525,7 @@ type RecursiveKeyOf<TObj extends object> = {
525
525
  type RecursiveKeyOfInner<TObj extends object> = {
526
526
  [TKey in keyof TObj & (string | number)]: RecursiveKeyOfHandleValue<TObj[TKey], `.${TKey}`>;
527
527
  }[keyof TObj & (string | number)];
528
- type RecursiveKeyOfHandleValue<TValue, Text extends string> = TValue extends any[] ? Text : TValue extends object ? Text | `${Text}${RecursiveKeyOfInner<TValue>}` : Text;
528
+ type RecursiveKeyOfHandleValue<TValue, Text extends string> = TValue extends Function ? undefined : TValue extends any[] ? Text | `${Text}.${number}` | `${Text}.${number}${RecursiveKeyOfInner<TValue[0]>}` : TValue extends object ? Text | `${Text}${RecursiveKeyOfInner<TValue>}` : Text;
529
529
 
530
530
  declare function toDeviceConfig(devices: ProgramDevice[]): DeviceConfig[];
531
531
 
package/dist/index.js CHANGED
@@ -5113,6 +5113,7 @@ var getPeriod = (progress) => {
5113
5113
  // src/fhir/seenDisplay.ts
5114
5114
 
5115
5115
  function generateFHIRSeenDisplay(id, seenDisplay) {
5116
+ var _a;
5116
5117
  const contentCodeableConcept = {
5117
5118
  coding: [
5118
5119
  {
@@ -5122,6 +5123,17 @@ function generateFHIRSeenDisplay(id, seenDisplay) {
5122
5123
  }
5123
5124
  ]
5124
5125
  };
5126
+ const hasBlocks = ((_a = seenDisplay.content) == null ? void 0 : _a.blocks) && seenDisplay.content.blocks.length > 0;
5127
+ let contentData;
5128
+ if (hasBlocks) {
5129
+ contentData = JSON.stringify(seenDisplay.content.blocks);
5130
+ } else {
5131
+ contentData = getText(
5132
+ seenDisplay.content,
5133
+ "default.message",
5134
+ seenDisplay.lng
5135
+ );
5136
+ }
5125
5137
  const payload = seenDisplay.content ? [
5126
5138
  {
5127
5139
  contentAttachment: {
@@ -5132,9 +5144,7 @@ function generateFHIRSeenDisplay(id, seenDisplay) {
5132
5144
  "default.title",
5133
5145
  seenDisplay.lng
5134
5146
  ),
5135
- data: _2.Buffer.from(
5136
- getText(seenDisplay.content, "default.message", seenDisplay.lng)
5137
- ).toString("base64")
5147
+ data: _2.Buffer.from(contentData).toString("base64")
5138
5148
  },
5139
5149
  contentCodeableConcept
5140
5150
  }