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

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.
@@ -350,20 +350,23 @@ let generateHTMLWellbeingReport = async (data, isDebugging, clientName, language
350
350
  let mindTips = []
351
351
  let bodyTips = []
352
352
  let i = 0;
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
- }
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
+ })
367
370
  }
368
371
  });
369
372
 
@@ -654,13 +657,13 @@ let renderInsightTips = (tips) => {
654
657
  let insightClass = 'insight-container-without-img';
655
658
  let tipsTextClass = ''
656
659
  if (index === 0) {
657
- if (tip.partId === 1) {
660
+ if (tip.type === 'lifeStyleInsights') {
658
661
  tipImage = lifestyleImage
659
662
  }
660
- if (tip.partId === 2) {
663
+ if (tip.type === 'bodyInsights') {
661
664
  tipImage = bodyImage
662
665
  }
663
- if (tip.partId === 3) {
666
+ if (tip.type === 'mindInsights') {
664
667
  tipImage = mindImage
665
668
  }
666
669
  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.284",
4
- "description": "Nasco corporate report - latest update in 10/9/2023 - Fix HRC for bionext",
3
+ "version": "1.0.285",
4
+ "description": "Nasco corporate report - latest update in 24/4/2023 - Fix translation for SanusX PDF",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "start": "node index.js"