@medicus.ai/medicus-report-pdf-generator 1.3.6 → 1.3.8

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/lib/template.js CHANGED
@@ -200,7 +200,8 @@ function renderOneBiomarker(biomarker, isRtl, nestingLevel, isChildBiomarker, is
200
200
  if (biomarker.showInDetailsView === true) {
201
201
  const biomarkerCssId = "dtl-bio-" + "db" + biomarker.id;
202
202
  let customBiomarkerValueFontSize = '';
203
- const formattedValue = biomarker.formattedValue.replace(/,/g, "");
203
+ const rawFormattedValue = biomarker.formattedValue || biomarker.lingualReading || '';
204
+ const formattedValue = rawFormattedValue.replace(/,/g, "");
204
205
  if (formattedValue.length > 35) {
205
206
  customBiomarkerValueFontSize = 'font-size:12px;';
206
207
  }
@@ -231,13 +232,13 @@ function renderOneBiomarker(biomarker, isRtl, nestingLevel, isChildBiomarker, is
231
232
 
232
233
  // IMC special case (large biomarker value)
233
234
  let biomarkerClass = '';
234
- if (biomarker.formattedValue.length >= 125) {
235
+ if (rawFormattedValue.length >= 125) {
235
236
  biomarkerClass = 'large-value-class';
236
237
  firstGridColClass = '';
237
238
  // firstGridColstyle = 'width:100%';
238
239
  }
239
240
 
240
- const biomarkerValue = biomarker.formattedValue.replace(/\r\n/g, "<br/>");
241
+ const biomarkerValue = rawFormattedValue.replace(/\r\n/g, "<br/>");
241
242
 
242
243
  if (!biomarker.showScale) {
243
244
  biomarkerClass += ' hide-scale ';
@@ -1060,7 +1061,7 @@ function renderBiomarkerV3(biomarker, nestingLevel, isChildBiomarker, isCompactV
1060
1061
  if (isCompactView && biomarker.showInCompactView) {
1061
1062
  let biomarkerName = biomarker.fullName || '';
1062
1063
  let biomarkerUnit = biomarker.unit;
1063
- let biomarkerValue = biomarker.formattedValue || '';
1064
+ let biomarkerValue = biomarker.formattedValue || biomarker.lingualReading || '';
1064
1065
  let rangePlaceholder = '';
1065
1066
  let referenceRange = '';
1066
1067
  let biomarkerLast = '-';