@medicus.ai/medicus-report-pdf-generator 1.0.172 → 1.0.175

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "logo": "https://i.ibb.co/CHWgz4m/pdf-logo.png",
2
+ "logo": "https://i.ibb.co/kQTr8Cx/B-Next-Logo.png",
3
3
  "body_icon": "https://i.ibb.co/2hfhHM3/body-section.png",
4
4
  "lifestyle_icon": "https://i.ibb.co/ZNkkF12/lifestyle-section.png",
5
5
  "mind_icon": "https://i.ibb.co/gVjxNZ7/mind-section.png",
@@ -100,7 +100,8 @@ let generateHTMLWellbeingReport = async (data, isDebugging, clientName, language
100
100
  }
101
101
 
102
102
 
103
- let client = data.clientName ? data.clientName : 'default'
103
+ let client = clientName ? clientName : 'default'
104
+ console.log("client", client)
104
105
  let pathFile = path.resolve(__dirname + '/../config/' + client + '.json');
105
106
  let defaultConfig = require('../config/default.json');
106
107
  if (fs.existsSync(pathFile)) {
@@ -225,12 +226,12 @@ let generateHTMLWellbeingReport = async (data, isDebugging, clientName, language
225
226
  $("#chartsData").append("<script> var RANGE_COLORS = ['" + first_level_color + "','" + second_level_color + "','" + third_level_color + "','" + forth_level_color + "','" + fifth_level_color + "'];</script>");
226
227
 
227
228
  /* First section */
228
- let physicalScore = data.calculation.physicalScore.toFixed(1)
229
+ let physicalScore = !empty(data.calculation.physicalScore) ? data.calculation.physicalScore.toFixed(1) : 0
229
230
  let physicalAmount = ((physicalScore > 40 && physicalScore < 70) ? 255 : (physicalScore >= 70) ? 253 : 214);
230
231
  let physicalColor = (physicalScore > 40 && physicalScore < 70) ? third_level_color : (physicalScore >= 70) ? fifth_level_color : client === 'nasco' ? second_level_color : first_level_color;
231
232
 
232
233
  const rotatePhysicalAmount = (physicalScore / 100) * physicalAmount;
233
- let psychologicalScore = data.calculation.psychologicalScore.toFixed(1)
234
+ let psychologicalScore = !empty(data.calculation.psychologicalScore) ? data.calculation.psychologicalScore.toFixed(1) : 0
234
235
  let psychologicalAmount = ((psychologicalScore > 40 && psychologicalScore < 70) ? 255 : (psychologicalScore >= 70) ? 253 : 214);
235
236
  let psychologicalColor = (psychologicalScore > 40 && psychologicalScore < 70) ? third_level_color : (psychologicalScore >= 70) ? fifth_level_color : client === 'nasco' ? second_level_color : first_level_color;
236
237
  const rotatePsychologicalAmount = (psychologicalScore / 100) * psychologicalAmount;
@@ -241,7 +242,7 @@ let generateHTMLWellbeingReport = async (data, isDebugging, clientName, language
241
242
  .replace("{{PhysicalWord}}", localeService.t('physical'))
242
243
  .replace(/{{rotatePhysicalAmount}}/gi, rotatePhysicalAmount)
243
244
  .replace(/{{physicalColor}}/gi, physicalColor)
244
- .replace("{{psychologicalScore}}", data.calculation.psychologicalScore.toFixed(1))
245
+ .replace("{{psychologicalScore}}", !empty(data.calculation.psychologicalScore) ? data.calculation.psychologicalScore.toFixed(1) : 0)
245
246
  .replace("{{psychologicalWord}}", localeService.t('psychological'))
246
247
  .replace("{{psychologicalScoreStatement}}", data.calculation.psychologicalScoreStatement)
247
248
  .replace(/{{rotatePsychologicalAmount}}/gi, rotatePsychologicalAmount)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@medicus.ai/medicus-report-pdf-generator",
3
- "version": "1.0.172",
4
- "description": "Medicus PDF Generator - latest update in 26/10/2021 - Support new languages tr in wellbeing report",
3
+ "version": "1.0.175",
4
+ "description": "Medicus PDF Generator - latest update in 17/2/2022 - Fix bionext colors and logo",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "start": "node index.js"