@medicus.ai/medicus-report-pdf-generator 1.0.310 → 1.0.311
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.
|
@@ -2983,6 +2983,7 @@ div#screenshot {
|
|
|
2983
2983
|
width: 24px !important;
|
|
2984
2984
|
position: absolute;
|
|
2985
2985
|
bottom: 0;
|
|
2986
|
+
left: 25px;
|
|
2986
2987
|
height: auto !important;
|
|
2987
2988
|
transform: rotate(296deg);
|
|
2988
2989
|
}
|
|
@@ -2990,7 +2991,7 @@ div#screenshot {
|
|
|
2990
2991
|
.needle-container {
|
|
2991
2992
|
position: absolute;
|
|
2992
2993
|
right: 0px;
|
|
2993
|
-
top:
|
|
2994
|
+
top: 40px;
|
|
2994
2995
|
left: 0;
|
|
2995
2996
|
height: 130px;
|
|
2996
2997
|
width: 100px;
|
|
@@ -2999,9 +3000,19 @@ div#screenshot {
|
|
|
2999
3000
|
margin-right: auto;
|
|
3000
3001
|
}
|
|
3001
3002
|
|
|
3002
|
-
.needle-
|
|
3003
|
-
|
|
3003
|
+
.needle-container2 {
|
|
3004
|
+
position: absolute;
|
|
3005
|
+
right: 0px;
|
|
3006
|
+
top: 0px;
|
|
3007
|
+
left: 0;
|
|
3008
|
+
height: 130px;
|
|
3009
|
+
width: 100px;
|
|
3010
|
+
margin-left: auto;
|
|
3011
|
+
/* margin-top: 1rem; */
|
|
3012
|
+
margin-right: auto;
|
|
3004
3013
|
}
|
|
3014
|
+
|
|
3015
|
+
|
|
3005
3016
|
.speedometer-value {
|
|
3006
3017
|
z-index: 5;
|
|
3007
3018
|
top: 50px;
|
package/index.js
CHANGED
|
@@ -219,7 +219,7 @@ module.exports = {
|
|
|
219
219
|
let html = await generateHTMLWellbeingReportWithSmartReport(decodedJSON, isDebugging, reportData.client, reportData.language);
|
|
220
220
|
|
|
221
221
|
// 3: save PDF buffer
|
|
222
|
-
let fileBuffer =
|
|
222
|
+
let fileBuffer =await generatePDFReport({...html,client:reportData.client});
|
|
223
223
|
if (isDebugging) {
|
|
224
224
|
console.log('3: save PDF buffer')
|
|
225
225
|
LOGS += '3: save PDF buffer' + '\n' + '=============' + '\n';
|
|
@@ -528,16 +528,20 @@ let generateHTMLWellbeingReportWithSmartReport = async (data, isDebugging, clien
|
|
|
528
528
|
if(!empty(wellbeingData)){
|
|
529
529
|
/* First section */
|
|
530
530
|
let physicalScore = wellbeingData.calculation.physicalScore?.toFixed(1)
|
|
531
|
-
let physicalAmount = ((physicalScore > 40 && physicalScore < 70) ?
|
|
531
|
+
let physicalAmount = ((physicalScore > 40 && physicalScore < 70) ? 310 : (physicalScore >= 70) ? 310 : 300);
|
|
532
532
|
let physicalColor = (physicalScore > 40 && physicalScore < 70) ? third_level_color : (physicalScore >= 70) ? fifth_level_color : client === 'nasco' ? second_level_color : first_level_color;
|
|
533
533
|
|
|
534
534
|
let rotatePhysicalAmount = (physicalScore / 100) * physicalAmount;
|
|
535
|
+
if(physicalScore<=20){
|
|
536
|
+
rotatePhysicalAmount+=25
|
|
537
|
+
}
|
|
538
|
+
|
|
535
539
|
if (rotatePhysicalAmount > 336) {
|
|
536
540
|
rotatePhysicalAmount = 336
|
|
537
541
|
}
|
|
538
542
|
|
|
539
543
|
let depressionRiskScore = wellbeingData.calculation.depressionRiskScore?.toFixed(1)
|
|
540
|
-
let depressionRiskAmount =
|
|
544
|
+
let depressionRiskAmount = ((depressionRiskScore > 40 && depressionRiskScore < 70) ? 310 : (depressionRiskScore >= 70) ? 310 : 300);
|
|
541
545
|
let depressionRiskColor = (depressionRiskScore > 40 && depressionRiskScore < 70) ? third_level_color : (depressionRiskScore >= 70) ? fifth_level_color : client === 'nasco' ? second_level_color : first_level_color;
|
|
542
546
|
|
|
543
547
|
let rotateDepressionRiskAmount = (depressionRiskScore / 100) * depressionRiskAmount;
|
|
@@ -546,7 +550,7 @@ let generateHTMLWellbeingReportWithSmartReport = async (data, isDebugging, clien
|
|
|
546
550
|
}
|
|
547
551
|
|
|
548
552
|
let anxietyRiskScore = wellbeingData.calculation.anxietyRiskScore?.toFixed(1)
|
|
549
|
-
let anxietyRiskAmount =
|
|
553
|
+
let anxietyRiskAmount =((anxietyRiskScore > 40 && anxietyRiskScore < 70) ? 310 : (anxietyRiskScore >= 70) ? 310 : 300);
|
|
550
554
|
let anxietyRiskColor = (anxietyRiskScore > 40 && anxietyRiskScore < 70) ? third_level_color : (anxietyRiskScore >= 70) ? fifth_level_color : client === 'nasco' ? second_level_color : first_level_color;
|
|
551
555
|
|
|
552
556
|
let rotateAnxietyRiskAmount = (anxietyRiskScore / 100) * anxietyRiskAmount;
|
package/package.json
CHANGED
|
@@ -13,20 +13,21 @@
|
|
|
13
13
|
</style>
|
|
14
14
|
<div id="screenshot">
|
|
15
15
|
<div class="speedometer-container">
|
|
16
|
-
<svg
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
<svg width="150" height="120" viewBox="0 0 92 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
17
|
+
<path
|
|
18
|
+
d="M47.7561 0.0346775C47.1753 0.00827408 46.5856 -0.000526428 45.9959 -0.000526428C45.4062 -0.000526428 44.8165 0.00827408 44.2356 0.0346775C32.7245 0.454498 22.2369 4.96779 14.1978 12.1602C13.8255 12.4929 13.8141 13.0764 14.1661 13.4311L14.7602 14.0287L17.251 16.5106L17.9119 17.1716C18.2376 17.4973 18.756 17.5087 19.1019 17.2033C25.87 11.2448 34.6343 7.48583 44.2356 7.08449C44.8165 7.04928 45.4062 7.04048 45.9959 7.04048C46.5856 7.04048 47.1753 7.04928 47.7561 7.08449C57.3574 7.48583 66.1217 11.2448 72.889 17.2112C73.2358 17.5166 73.7542 17.5061 74.0807 17.1795L74.7496 16.5106L77.2404 14.0287L77.8345 13.4311C78.1865 13.0764 78.1751 12.4929 77.8028 12.1602C69.7628 4.96779 59.2752 0.454498 47.7561 0.0346775Z"
|
|
19
|
+
fill="#F4A837" stroke="#F4A837" stroke-width="0"/>
|
|
20
|
+
<path
|
|
21
|
+
d="M91.9648 45.9963C91.5547 34.9727 87.2359 24.9278 80.3551 17.2074C80.0197 16.8307 79.4309 16.8201 79.0736 17.1757L77.8256 18.4202C77.4973 18.7476 77.4867 19.2686 77.7939 19.6154C84.0745 26.7004 88.0342 35.8951 88.4443 45.9963C88.4707 46.5772 88.4795 47.1669 88.4795 47.7566C88.4795 48.3462 88.4707 48.9359 88.4443 49.5168C88.0342 59.6171 84.0745 68.8118 77.7939 75.8977C77.4867 76.2445 77.4973 76.7655 77.8256 77.0929L79.0789 78.3418C79.4336 78.6957 80.0171 78.6851 80.3507 78.311C87.2341 70.5897 91.5547 60.543 91.9648 49.5168C91.9912 48.9271 92 48.3462 92 47.7566C92 47.1669 91.9912 46.586 91.9648 45.9963Z"
|
|
22
|
+
fill="#02D9D1" stroke="#02D9D1" stroke-width="3"/>
|
|
23
|
+
<path
|
|
24
|
+
d="M3.52051 47.7566C3.52051 47.1669 3.52931 46.5772 3.55571 45.9963C3.96673 35.8951 7.92554 26.7004 14.2061 19.6154C14.5133 19.2686 14.5036 18.7476 14.1744 18.4202L12.9211 17.1713C12.5664 16.8175 11.9829 16.828 11.6494 17.2021C4.76588 24.9234 0.445344 34.9701 0.035205 45.9963C0.00880123 46.586 0 47.1669 0 47.7566C0 48.3463 0.00880123 48.9271 0.035205 49.5168C0.445344 60.543 4.76588 70.5897 11.6494 78.311C11.9829 78.6851 12.5664 78.6957 12.9211 78.3418L14.1744 77.0929C14.5036 76.7655 14.5133 76.2445 14.2061 75.8977C7.92554 68.8118 3.96673 59.6171 3.55571 49.5168C3.52931 48.9359 3.52051 48.3463 3.52051 47.7566Z"
|
|
25
|
+
fill="#ED6D59" stroke="#ED6D59" stroke-width="3"/>
|
|
26
|
+
</svg>
|
|
26
27
|
|
|
27
28
|
</div>
|
|
28
29
|
|
|
29
|
-
<div class="needle-container loading_Meter2
|
|
30
|
+
<div class="needle-container loading_Meter2 ">
|
|
30
31
|
<svg class="ui image meter-needle " version="1.2" baseProfile="tiny-ps" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 65 57" width="65" height="57">
|
|
31
32
|
<g id="Layer">
|
|
32
33
|
<path id="Layer" class="shp0" fill="none" d="M-4.05 94.8L-30.63 57.17L386.92 -218.49L413.51 -180.86L-4.05 94.8Z" />
|
|
@@ -85,20 +86,28 @@
|
|
|
85
86
|
</style>
|
|
86
87
|
<div id="screenshot">
|
|
87
88
|
<div class="speedometer-container">
|
|
88
|
-
<svg
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
<svg width="150" height="120" viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
90
|
+
<path d="M68.9641 8.0985C69.2649 7.63531 69.885 7.50276 70.3414 7.81377C75.5335 11.352 79.9304 15.9407 83.2452 21.287C86.56 26.6332 88.7151 32.6119 89.5758 38.8358C89.6515 39.3828 89.257 39.8793 88.7084 39.9428L86.672 40.1784C86.1234 40.2419 85.6284 39.8483 85.5516 39.3014C84.7602 33.6697 82.8038 28.2607 79.8031 23.4212C76.8024 18.5816 72.8274 14.4242 68.1349 11.2113C67.6792 10.8993 67.5468 10.281 67.8476 9.81777L68.9641 8.0985Z"
|
|
91
|
+
fill="{{forthLevelColor}}" stroke="{{forthLevelColor}}" stroke-width="2"/>
|
|
92
|
+
|
|
93
|
+
<path
|
|
94
|
+
d="M26.4048 5.12246C26.1714 4.62192 26.3876 4.02584 26.8932 3.80361C32.6452 1.27543 38.8666 -0.0216826 45.1571 0.000274124C51.4475 0.0222308 57.6597 1.36275 63.394 3.93101C63.898 4.15676 64.11 4.75434 63.8731 5.25324L62.9938 7.10507C62.7569 7.60397 62.1609 7.81517 61.6564 7.59053C56.461 5.27733 50.8372 4.07012 45.1429 4.05025C39.4486 4.03037 33.8165 5.19829 28.6052 7.47516C28.0991 7.69628 27.5046 7.48093 27.2712 6.98039L26.4048 5.12246Z"
|
|
95
|
+
fill="{{thirdLevelColor}}" stroke="{{thirdLevelColor}}" stroke-width="2"/>
|
|
96
|
+
|
|
97
|
+
<path d="M1.32797 39.6377C0.779802 39.5704 0.388848 39.0712 0.468318 38.5247C1.37242 32.307 3.56925 26.3435 6.92131 21.0206C10.2734 15.6976 14.7022 11.1397 19.9189 7.63776C20.3774 7.32994 20.9965 7.46682 21.2941 7.93209L22.3986 9.65912C22.6961 10.1244 22.5594 10.7418 22.1015 11.0506C17.3867 14.2307 13.3828 18.3602 10.3484 23.1787C7.31402 27.9972 5.31991 33.3924 4.48922 39.0184C4.40854 39.5648 3.91086 39.9549 3.36269 39.8876L1.32797 39.6377Z"
|
|
98
|
+
fill="{{firstLevelColor}}" stroke="{{firstLevelColor}}" stroke-width="2"/>
|
|
99
|
+
|
|
100
|
+
<path d="M15.5583 77.6984C15.1887 78.1088 14.5555 78.1427 14.1534 77.7641C9.57873 73.4572 5.95383 68.2372 3.51616 62.4382C1.07849 56.6392 -0.114859 50.3971 0.00869898 44.1152C0.0195597 43.563 0.486795 43.1343 1.0386 43.1575L3.0868 43.2433C3.6386 43.2664 4.06589 43.7326 4.05624 44.2848C3.9569 49.9709 5.04306 55.6194 7.2497 60.8688C9.45634 66.1182 12.7321 70.8462 16.8642 74.7536C17.2654 75.1331 17.2995 75.7645 16.93 76.1749L15.5583 77.6984Z"
|
|
101
|
+
fill="{{fifthLevelColor}}" stroke="{{fifthLevelColor}}" stroke-width="2"/>
|
|
102
|
+
|
|
103
|
+
<path d="M87.9738 43.4993C89.0777 43.4608 90.0085 44.3247 89.998 45.4293C89.9413 51.3724 88.7076 57.2525 86.3611 62.7274C84.0145 68.2023 80.6071 73.1507 76.3423 77.2902C75.5497 78.0596 74.2822 77.9813 73.5488 77.1553L72.0218 75.4354C71.2884 74.6094 71.3676 73.3489 72.1546 72.5739C75.7288 69.054 78.5893 64.868 80.5705 60.2456C82.5517 55.6231 83.6104 50.6649 83.6946 45.6491C83.7131 44.5447 84.5713 43.6182 85.6752 43.5796L87.9738 43.4993Z"
|
|
104
|
+
fill="{{secondLevelColor}}" stroke="{{secondLevelColor}}" stroke-width="0"/>
|
|
97
105
|
</svg>
|
|
106
|
+
|
|
98
107
|
|
|
99
108
|
</div>
|
|
100
109
|
|
|
101
|
-
<div class="
|
|
110
|
+
<div class=" loading_Meter1
|
|
102
111
|
needle-container2">
|
|
103
112
|
<svg class="ui image meter-needle " version="1.2" baseProfile="tiny-ps" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 65 57" width="65" height="57">
|
|
104
113
|
<g id="Layer">
|
|
@@ -138,22 +147,24 @@
|
|
|
138
147
|
</style>
|
|
139
148
|
<div id="screenshot">
|
|
140
149
|
<div class="speedometer-container">
|
|
141
|
-
<svg
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
<svg width="150" height="120" viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
151
|
+
<path d="M48.0693 1.10718C48.1078 0.556242 48.5859 0.139702 49.1359 0.190458C57.2942 0.943409 65.0992 3.9104 71.7039 8.77979C78.3085 13.6492 83.4508 20.2278 86.5826 27.7986C86.7937 28.3089 86.5372 28.8888 86.0223 29.0885L82.0133 30.6435C81.4984 30.8432 80.9202 30.5871 80.7073 30.0775C78.0091 23.621 73.6077 18.0105 67.9653 13.8506C62.3229 9.69069 55.6619 7.14521 48.6962 6.47691C48.1465 6.42417 47.7308 5.94765 47.7693 5.39671L48.0693 1.10718Z"
|
|
152
|
+
fill="{{thirdLevelColor}}" stroke="{{thirdLevelColor}}" stroke-width="0"/>
|
|
153
|
+
|
|
154
|
+
<path d="M4.20391 28.5173C3.69184 28.3104 3.44343 27.727 3.66164 27.2197C6.8988 19.6933 12.1325 13.1871 18.8045 8.41046C25.4765 3.63377 33.3222 0.776044 41.4902 0.137079C42.0408 0.0940063 42.513 0.517182 42.5439 1.06861L42.6583 3.11541C42.6891 3.66683 42.2669 4.13758 41.7164 4.18186C34.3157 4.77716 27.2092 7.37422 21.1621 11.7035C15.115 16.0328 10.3663 21.9233 7.41775 28.7372C7.19842 29.2441 6.61671 29.4921 6.10464 29.2853L4.20391 28.5173Z"
|
|
155
|
+
fill="{{firstLevelColor}}" stroke="{{firstLevelColor}}" stroke-width="2"/>
|
|
156
|
+
|
|
157
|
+
<path d="M14.9921 77.1796C14.6154 77.5835 13.9817 77.6063 13.5863 77.2208C7.71993 71.5014 3.52148 64.2838 1.45309 56.3431C-0.615302 48.4025 -0.47158 40.0538 1.85905 32.1993C2.01616 31.6698 2.58046 31.3806 3.10631 31.5494L5.05817 32.1761C5.58402 32.3449 5.87217 32.9078 5.71623 33.4377C3.61984 40.5601 3.49765 48.1253 5.37231 55.3222C7.24697 62.5192 11.0444 69.0634 16.3491 74.258C16.7437 74.6444 16.7668 75.2764 16.3902 75.6803L14.9921 77.1796Z"
|
|
158
|
+
fill="{{fifthLevelColor}}" stroke="{{fifthLevelColor}}" stroke-width="2"/>
|
|
159
|
+
|
|
160
|
+
<path d="M86.3343 33.1476C87.396 32.8431 88.5082 33.4563 88.7652 34.5306C90.5912 42.1636 90.3916 50.1541 88.1691 57.7054C85.9467 65.2567 81.7859 72.0814 76.1162 77.5082C75.3182 78.272 74.0512 78.185 73.3236 77.3539L73.2907 77.3162C72.5631 76.4851 72.6509 75.225 73.4455 74.4578C78.5387 69.5396 82.2785 63.3758 84.2839 56.5619C86.2894 49.748 86.4848 42.541 84.8678 35.648C84.6156 34.5726 85.2244 33.4659 86.2862 33.1614L86.3343 33.1476Z"
|
|
161
|
+
fill="{{secondLevelColor}}" stroke="{{secondLevelColor}}" stroke-width="2"/>
|
|
152
162
|
</svg>
|
|
163
|
+
|
|
153
164
|
|
|
154
165
|
</div>
|
|
155
166
|
|
|
156
|
-
<div class="
|
|
167
|
+
<div class=" loading_Meter3 needle-container2">
|
|
157
168
|
<svg class="ui image meter-needle " version="1.2" baseProfile="tiny-ps" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 65 57" width="65" height="57">
|
|
158
169
|
<g id="Layer">
|
|
159
170
|
<path id="Layer" class="shp0" fill="none" d="M-4.05 94.8L-30.63 57.17L386.92 -218.49L413.51 -180.86L-4.05 94.8Z" />
|
package/test.js
CHANGED
|
@@ -64,7 +64,7 @@ const data = {
|
|
|
64
64
|
"anxietyRiskScoreStatement": "",
|
|
65
65
|
"depressionRiskScore": 40.0,
|
|
66
66
|
"depressionRiskScoreStatement": "",
|
|
67
|
-
"physicalScore":
|
|
67
|
+
"physicalScore": 40.0,
|
|
68
68
|
"physicalScoreStatement": "Your <strong>physical wellbeing score</strong> shows that you are just getting started, and your healthy practices are in a good position to go even further.",
|
|
69
69
|
"psychologicalScore": 0.0,
|
|
70
70
|
"psychologicalScoreStatement": ""
|