@medicus.ai/medicus-report-pdf-generator 1.0.285 → 1.0.286

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.
@@ -243,12 +243,12 @@ let generateHTMLWellbeingReport = async (data, isDebugging, clientName, language
243
243
 
244
244
  /* First section */
245
245
  let physicalScore = data.calculation.physicalScore.toFixed(1)
246
- let physicalAmount = ((physicalScore > 40 && physicalScore < 70) ? 255 : (physicalScore >= 70) ? 369 : 214);
246
+ let physicalAmount = ((physicalScore > 40 && physicalScore < 70) ? 255 : (physicalScore >= 70) ? 340 : 214);
247
247
  let physicalColor = (physicalScore > 40 && physicalScore < 70) ? third_level_color : (physicalScore >= 70) ? fifth_level_color : client === 'nasco' ? second_level_color : first_level_color;
248
248
 
249
249
  const rotatePhysicalAmount = (physicalScore / 100) * physicalAmount;
250
250
  let psychologicalScore = data.calculation.psychologicalScore.toFixed(1)
251
- let psychologicalAmount = ((psychologicalScore > 40 && psychologicalScore < 70) ? 255 : (psychologicalScore >= 70) ? 369 : 214);
251
+ let psychologicalAmount = ((psychologicalScore > 40 && psychologicalScore < 70) ? 255 : (psychologicalScore >= 70) ? 340 : 214);
252
252
  let psychologicalColor = (psychologicalScore > 40 && psychologicalScore < 70) ? third_level_color : (psychologicalScore >= 70) ? fifth_level_color : client === 'nasco' ? second_level_color : first_level_color;
253
253
  const rotatePsychologicalAmount = (psychologicalScore / 100) * psychologicalAmount;
254
254
 
@@ -350,23 +350,20 @@ let generateHTMLWellbeingReport = async (data, isDebugging, clientName, language
350
350
  let mindTips = []
351
351
  let bodyTips = []
352
352
  let i = 0;
353
- Object.entries(partScores).map(([key, value], index) => {
354
- if (key === 'bodyInsights' || key === 'lifeStyleInsights' || key === 'mindInsights') {
355
- partScores[key]['tips'].map((tip, index) => {
356
- if (key === 'lifeStyleInsights') {
357
- tip.type = 'lifeStyleInsights'
358
- lifeStyleTips.push(tip)
359
- }
360
- if (key === 'bodyInsights') {
361
- tip.type = 'bodyInsights'
362
- bodyTips.push(tip)
363
- }
364
- if (key === 'mindInsights') {
365
- tip.type = 'mindInsights'
366
- mindTips.push(tip)
367
- }
368
- i++;
369
- })
353
+ tips.map((key, index) => {
354
+ if (key.partId === 1 || key.partId === 2 || key.partId === 3) {
355
+ if (key.partId === 1) {
356
+ key.type = 'lifeStyleInsights'
357
+ lifeStyleTips.push(key)
358
+ }
359
+ if (key.partId === 2) {
360
+ key.type = 'bodyInsights'
361
+ bodyTips.push(key)
362
+ }
363
+ if (key.partId === 3) {
364
+ key.type = 'mindInsights'
365
+ mindTips.push(key)
366
+ }
370
367
  }
371
368
  });
372
369
 
@@ -657,13 +654,13 @@ let renderInsightTips = (tips) => {
657
654
  let insightClass = 'insight-container-without-img';
658
655
  let tipsTextClass = ''
659
656
  if (index === 0) {
660
- if (tip.type === 'lifeStyleInsights') {
657
+ if (tip.partId === 1) {
661
658
  tipImage = lifestyleImage
662
659
  }
663
- if (tip.type === 'bodyInsights') {
660
+ if (tip.partId === 2) {
664
661
  tipImage = bodyImage
665
662
  }
666
- if (tip.type === 'mindInsights') {
663
+ if (tip.partId === 3) {
667
664
  tipImage = mindImage
668
665
  }
669
666
  insightClass = "insight-container-with-img";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@medicus.ai/medicus-report-pdf-generator",
3
- "version": "1.0.285",
4
- "description": "Nasco corporate report - latest update in 24/4/2023 - Fix translation for SanusX PDF",
3
+ "version": "1.0.286",
4
+ "description": "Nasco corporate report - latest update in 10/9/2023 - Fix HRC for bionext",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "start": "node index.js"