@medicus.ai/medicus-report-pdf-generator 1.3.31 → 1.3.33
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/config/Pha.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"lifestyle_icon": "https://i.ibb.co/ZNkkF12/lifestyle-section.png",
|
|
6
6
|
"mind_icon": "https://i.ibb.co/gVjxNZ7/mind-section.png",
|
|
7
7
|
"bulb_icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAoCAYAAAB5ADPdAAABYWlDQ1BrQ0dDb2xvclNwYWNlRGlzcGxheVAzAAAokWNgYFJJLCjIYWFgYMjNKykKcndSiIiMUmB/yMAOhLwMYgwKicnFBY4BAT5AJQwwGhV8u8bACKIv64LMOiU1tUm1XsDXYqbw1YuvRJsw1aMArpTU4mQg/QeIU5MLikoYGBhTgGzl8pICELsDyBYpAjoKyJ4DYqdD2BtA7CQI+whYTUiQM5B9A8hWSM5IBJrB+API1klCEk9HYkPtBQFul8zigpzESoUAYwKuJQOUpFaUgGjn/ILKosz0jBIFR2AopSp45iXr6SgYGRiaMzCAwhyi+nMgOCwZxc4gxJrvMzDY7v",
|
|
8
|
-
"first-level-color": "#
|
|
9
|
-
"second-level-color": "#
|
|
10
|
-
"third-level-color": "#
|
|
11
|
-
"forth-level-color": "#
|
|
12
|
-
"fifth-level-color": "#
|
|
8
|
+
"first-level-color": "#EF4444",
|
|
9
|
+
"second-level-color": "#EF4444",
|
|
10
|
+
"third-level-color": "#F59E0B",
|
|
11
|
+
"forth-level-color": "#F59E0B",
|
|
12
|
+
"fifth-level-color": "#10B981",
|
|
13
13
|
"score-header-color": "#0F2062",
|
|
14
14
|
"score-description-color": "#0F2062",
|
|
15
15
|
"svg-icon-color": "#2D4A8C",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"section-title-border-color": "#0F2062",
|
|
18
18
|
"first-section-scores-border-color": "#0F2062",
|
|
19
19
|
"general-font-color": "#A43B2F",
|
|
20
|
-
"disclaimer-text-color": "
|
|
20
|
+
"disclaimer-text-color": "#000000",
|
|
21
21
|
"top-box-background": "#f0f4ff",
|
|
22
22
|
"footer-background": "rgba(15, 32, 98, 0.14)",
|
|
23
23
|
"footer-border-color": "#0F2062",
|
|
@@ -7,7 +7,7 @@ const path = require("path");
|
|
|
7
7
|
const LocaleService = require('../app/services/localeService.js');
|
|
8
8
|
const i18n = require('../app/i18n_wellbeing.config.js');
|
|
9
9
|
const puppeteer = require("puppeteer");
|
|
10
|
-
const hummus = require('
|
|
10
|
+
const hummus = require('muhammara');
|
|
11
11
|
const memoryStreams = require('memory-streams');
|
|
12
12
|
|
|
13
13
|
var localeService = new LocaleService(i18n);
|
package/lib/pdf_generator.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const fs = require("fs"), {promisify: promisify} = require("util"), {JSDOM: JSDOM} = require("jsdom"),
|
|
3
|
-
fetch = require("node-fetch"), hummus = require("
|
|
3
|
+
fetch = require("node-fetch"), hummus = require("muhammara"), memoryStreams = require("memory-streams"),
|
|
4
4
|
path = require("path"), LocaleService = require("../app/services/localeService.js"),
|
|
5
5
|
i18n = require("../app/i18n.config.js"), puppeteer = require("puppeteer");
|
|
6
6
|
var Chart = require("chart.js"), QRCode = require("qrcode"), localeService = new LocaleService(i18n);
|
|
@@ -60,6 +60,24 @@ let debugLog = (val1, val2 = "") => {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
// PHA-only: grey report text is hard to read when printed, so it renders black. Status and
|
|
64
|
+
// chart colours are not listed here, and neither are the .title of a status-coloured card or
|
|
65
|
+
// an .insight-content with an inline colour (the theme already sets it).
|
|
66
|
+
const PHA_BLACK_TEXT_STYLE = '<style>' + [
|
|
67
|
+
'.html-content', '.html-content *', '.card', '.stats-card', '.section-content', '.insight-content:not([style*="color"])',
|
|
68
|
+
'.insight-disclaimer', '.details-label', '.details-label *', '.details-value',
|
|
69
|
+
'.info-label', '.info-value', '.info-title', '.client-name',
|
|
70
|
+
'.panel-title', '.panel-title-text', '.resume-title', '.report-title', '.panel-subtitle',
|
|
71
|
+
'.panel-subtitle-item', '.panel-biomarker-title', '.panel-sample', '.bio-name-info',
|
|
72
|
+
'.card:not(.darkred):not(.dark-red):not(.red):not(.orange):not(.yellow):not(.light-blue):not(.lightblue):not(.blue) .title',
|
|
73
|
+
'.biom-method', '.method-type', '.lab-info', '.biom-past', '.biom-last', '.biom-range',
|
|
74
|
+
'.biom-past-data', '.biom-last-data', '.biom-range-data', '.parent-reference-range', '.child-referene-range',
|
|
75
|
+
'.biom-bar .labels td', '.biom-bar .labels td span:not(.colorable)', '.biom-bar .values td', '.biom-sample-value', '.related .label',
|
|
76
|
+
'.biomarker-notes', '.biomarker-notes span', 'tr.labels td span:not(.colorable)', 'tr.values td',
|
|
77
|
+
'.speedometer-value-up', '.speedometer-value-up *', '.speedometer-value-down', '.needle-value', '.needle-value *',
|
|
78
|
+
'.score-list', '.chunk-text', '.score-subtext', '.disclaimer-text', '.question-title'
|
|
79
|
+
].join(',') + '{color:#000 !important}.speedometer-value-down{opacity:1 !important}</style>';
|
|
80
|
+
|
|
63
81
|
// Config object to hold all configuration values
|
|
64
82
|
let config = {
|
|
65
83
|
logo: "",
|
|
@@ -104,13 +122,13 @@ const loadColorTheme = (clientName = 'default') => {
|
|
|
104
122
|
warningIcon: '#ffc107'
|
|
105
123
|
},
|
|
106
124
|
pha: {
|
|
107
|
-
headerText: '#
|
|
125
|
+
headerText: '#000000',
|
|
108
126
|
headerBackground: '#ECF0F1',
|
|
109
127
|
headerDivider: '#0F2062',
|
|
110
|
-
footerText: '#
|
|
128
|
+
footerText: '#000000',
|
|
111
129
|
listIcon: '#7F8C8D',
|
|
112
130
|
insightPrimary: '#0F2062',
|
|
113
|
-
insightSecondary: '#
|
|
131
|
+
insightSecondary: '#000000',
|
|
114
132
|
warningIcon: '#F39C12'
|
|
115
133
|
},
|
|
116
134
|
nasco: {
|
|
@@ -1281,6 +1299,7 @@ let generateHTMLWellbeingReportWithSmartReport = async (data, isDebugging, clien
|
|
|
1281
1299
|
$('#content').append(dynamicStyles);
|
|
1282
1300
|
|
|
1283
1301
|
if (client.toLowerCase() === 'pha') {
|
|
1302
|
+
$('#content').append(PHA_BLACK_TEXT_STYLE);
|
|
1284
1303
|
// PHA-only: compact patient info table to reduce total height.
|
|
1285
1304
|
$('#content').append('<style>.patient-details .details-column { gap: 2px !important; } .patient-details .details-row { margin-top: 2px !important; } .patient-details .details-label, .patient-details .details-value { padding: 2px 6px !important; }</style>');
|
|
1286
1305
|
// PHA-only: Prevent first page content from overlapping PDF footer (email/address)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicus.ai/medicus-report-pdf-generator",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.33",
|
|
4
4
|
"description": "Nasco corporate report - latest update in 12/10/2023 - Fix HRC for bionext",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,17 +13,14 @@
|
|
|
13
13
|
"babel-register": "^6.26.0",
|
|
14
14
|
"big-text.js": "^1.0.1",
|
|
15
15
|
"body-parser": "^1.18.3",
|
|
16
|
-
"canvas": "^2.11.2",
|
|
17
|
-
"canvas-constructor": "^3.2.0",
|
|
18
16
|
"chart.js": "^2.7.3",
|
|
19
17
|
"express": "^4.16.4",
|
|
20
|
-
"get-canvas-context": "^1.0.2",
|
|
21
|
-
"hummus": "1.0.111",
|
|
22
18
|
"i18n": "^0.8.3",
|
|
23
19
|
"i18n-nodejs": "^3.0.0",
|
|
24
20
|
"jquery": "^3.3.1",
|
|
25
|
-
"jsdom": "^
|
|
21
|
+
"jsdom": "^16.7.0",
|
|
26
22
|
"memory-streams": "^0.1.3",
|
|
23
|
+
"muhammara": "6.0.6",
|
|
27
24
|
"node-fetch": "^2.3.0",
|
|
28
25
|
"node-pdftk": "^2.0.2",
|
|
29
26
|
"node-qpdf2": "^6.0.0",
|
|
@@ -43,5 +40,11 @@
|
|
|
43
40
|
"babel-preset-es2015": "^6.24.1",
|
|
44
41
|
"babel-preset-stage-0": "^6.24.1",
|
|
45
42
|
"webpack": "^4.28.4"
|
|
43
|
+
},
|
|
44
|
+
"allowScripts": {
|
|
45
|
+
"puppeteer": true,
|
|
46
|
+
"muhammara": true,
|
|
47
|
+
"core-js": false,
|
|
48
|
+
"fsevents": false
|
|
46
49
|
}
|
|
47
50
|
}
|